@@ -18,8 +18,8 @@ type TableInputModel struct {
1818 Pattern string `tfsdk:"pattern"`
1919 Format * string `tfsdk:"format"`
2020 JSONHints []TableInputJSONHintModel `tfsdk:"json_hints"`
21- CSVHints [] TableInputCSVHintModel `tfsdk:"csv_hints"`
22- TSVHints [] TableInputTSVHintModel `tfsdk:"tsv_hints"`
21+ CSVHints * TableInputCSVHintModel `tfsdk:"csv_hints"`
22+ TSVHints * TableInputTSVHintModel `tfsdk:"tsv_hints"`
2323}
2424
2525func (m * TableInputModel ) MarshalJSON () ([]byte , error ) {
@@ -46,15 +46,15 @@ func (m *TableInputModel) MarshalJSON() ([]byte, error) {
4646 }
4747 sb .Write (hintsValue )
4848 }
49- if len ( m .CSVHints ) > 0 {
49+ if m .CSVHints != nil {
5050 sb .Write ([]byte (`,"hints":` ))
5151 hintsValue , err := json .Marshal (m .CSVHints )
5252 if err != nil {
5353 return nil , err
5454 }
5555 sb .Write (hintsValue )
5656 }
57- if len ( m .TSVHints ) > 0 {
57+ if m .TSVHints != nil {
5858 sb .Write ([]byte (`,"hints":` ))
5959 hintsValue , err := json .Marshal (m .TSVHints )
6060 if err != nil {
@@ -102,26 +102,26 @@ func (m *TableInputModel) UnmarshalJSON(data []byte) error {
102102
103103 case "csv" , "csv.gz" , "csv.zst" :
104104 var shadow struct {
105- Hints * [] TableInputCSVHintModel `json:"hints,omitempty"`
105+ Hints * TableInputCSVHintModel `json:"hints,omitempty"`
106106 }
107107 err := json .Unmarshal (data , & shadow )
108108 if err != nil {
109109 return err
110110 }
111111 if shadow .Hints != nil {
112- m .CSVHints = * shadow .Hints
112+ m .CSVHints = shadow .Hints
113113 }
114114
115115 case "tsv" , "tsv.gz" , "tsv.zst" :
116116 var shadow struct {
117- Hints * [] TableInputTSVHintModel `json:"hints,omitempty"`
117+ Hints * TableInputTSVHintModel `json:"hints,omitempty"`
118118 }
119119 err := json .Unmarshal (data , & shadow )
120120 if err != nil {
121121 return err
122122 }
123123 if shadow .Hints != nil {
124- m .TSVHints = * shadow .Hints
124+ m .TSVHints = shadow .Hints
125125 }
126126 }
127127
@@ -345,16 +345,16 @@ type TableInputJSONHintModel struct {
345345 Hints Hints `tfsdk:"hints" json:"hints"`
346346}
347347
348- type TableInputCSVHintModel [] struct {
348+ type TableInputCSVHintModel struct {
349349 Separator * string `tfsdk:"separator" json:"separator,omitempty"`
350- SkipRecords * int64 `tfsdk:"skip_records" json:"skipRecords ,omitempty"`
351- MissingValues []string `tfsdk:"missing_values" json:"missingValues ,omitempty"`
350+ SkipRecords * int64 `tfsdk:"skip_records" json:"skip_records ,omitempty"`
351+ MissingValues []string `tfsdk:"missing_values" json:"missing_values ,omitempty"`
352352 Fields []TableInputXSVHintsFieldModel `tfsdk:"fields" json:"fields,omitempty"`
353353}
354354
355- type TableInputTSVHintModel [] struct {
356- SkipRecords * int64 `tfsdk:"skip_records" json:"skipRecords ,omitempty"`
357- MissingValues []string `tfsdk:"missing_values" json:"missingValues ,omitempty"`
355+ type TableInputTSVHintModel struct {
356+ SkipRecords * int64 `tfsdk:"skip_records" json:"skip_records ,omitempty"`
357+ MissingValues []string `tfsdk:"missing_values" json:"missing_values ,omitempty"`
358358 Fields []TableInputXSVHintsFieldModel `tfsdk:"fields" json:"fields,omitempty"`
359359}
360360
@@ -365,9 +365,9 @@ type TableInputXSVHintsFieldModel struct {
365365 Format * string `tfsdk:"format" json:"format,omitempty"`
366366 AllowEmpty * bool `tfsdk:"allow_empty" json:"allowEmpty,omitempty"`
367367 NoIndex * bool `tfsdk:"no_index" json:"noIndex,omitempty"`
368- TrueValues []string `tfsdk:"true_values" json:"trueValues"`
369- FalseValues []string `tfsdk:"false_values" json:"falseValues"`
370- MissingValues []string `tfsdk:"missing_values" json:"missingValues"`
368+ TrueValues []string `tfsdk:"true_values" json:"trueValues,omitempty "`
369+ FalseValues []string `tfsdk:"false_values" json:"falseValues,omitempty "`
370+ MissingValues []string `tfsdk:"missing_values" json:"missingValues,omitempty "`
371371}
372372
373373type TablePartitionModel struct {
0 commit comments