@@ -40,9 +40,9 @@ func ProtoTypeToArrowType(sample *types.Value) (arrow.DataType, error) {
4040 case * types.Value_DoubleListVal :
4141 return arrow .ListOf (arrow .PrimitiveTypes .Float64 ), nil
4242 case * types.Value_UnixTimestampVal :
43- return arrow .FixedWidthTypes .Time64ns , nil
43+ return arrow .FixedWidthTypes .Time32s , nil
4444 case * types.Value_UnixTimestampListVal :
45- return arrow .ListOf (arrow .FixedWidthTypes .Time64ns ), nil
45+ return arrow .ListOf (arrow .FixedWidthTypes .Time32s ), nil
4646 default :
4747 return nil ,
4848 fmt .Errorf ("unsupported proto type in proto to arrow conversion: %s" , sample .Val )
@@ -80,9 +80,9 @@ func ValueTypeEnumToArrowType(t types.ValueType_Enum) (arrow.DataType, error) {
8080 case types .ValueType_DOUBLE_LIST :
8181 return arrow .ListOf (arrow .PrimitiveTypes .Float64 ), nil
8282 case types .ValueType_UNIX_TIMESTAMP :
83- return arrow .FixedWidthTypes .Time64ns , nil
83+ return arrow .FixedWidthTypes .Time32s , nil
8484 case types .ValueType_UNIX_TIMESTAMP_LIST :
85- return arrow .ListOf (arrow .FixedWidthTypes .Time64ns ), nil
85+ return arrow .ListOf (arrow .FixedWidthTypes .Time32s ), nil
8686 default :
8787 return nil ,
8888 fmt .Errorf ("unsupported value type enum in enum to arrow type conversion: %s" , t )
@@ -119,9 +119,9 @@ func copyProtoValuesToArrowArray(builder array.Builder, values []*types.Value) e
119119 for _ , v := range values {
120120 fieldBuilder .Append (v .GetDoubleVal ())
121121 }
122- case * array.Time64Builder :
122+ case * array.Time32Builder :
123123 for _ , v := range values {
124- fieldBuilder .Append (arrow .Time64 (v .GetUnixTimestampVal ()))
124+ fieldBuilder .Append (arrow .Time32 (v .GetUnixTimestampVal ()))
125125 }
126126 case * array.ListBuilder :
127127 for _ , list := range values {
@@ -157,9 +157,9 @@ func copyProtoValuesToArrowArray(builder array.Builder, values []*types.Value) e
157157 for _ , v := range list .GetDoubleListVal ().GetVal () {
158158 valueBuilder .Append (v )
159159 }
160- case * array.Time64Builder :
160+ case * array.Time32Builder :
161161 for _ , v := range list .GetUnixTimestampListVal ().GetVal () {
162- valueBuilder .Append (arrow .Time64 (v ))
162+ valueBuilder .Append (arrow .Time32 (v ))
163163 }
164164 }
165165 }
@@ -227,10 +227,10 @@ func ArrowValuesToProtoValues(arr arrow.Array) ([]*types.Value, error) {
227227 }
228228 values = append (values ,
229229 & types.Value {Val : & types.Value_BoolListVal {BoolListVal : & types.BoolList {Val : vals }}})
230- case arrow .FixedWidthTypes .Time64ns :
230+ case arrow .FixedWidthTypes .Time32s :
231231 vals := make ([]int64 , int (offsets [idx ])- pos )
232232 for j := pos ; j < int (offsets [idx ]); j ++ {
233- vals [j - pos ] = int64 (listValues .(* array.Time64 ).Value (j ))
233+ vals [j - pos ] = int64 (listValues .(* array.Time32 ).Value (j ))
234234 }
235235
236236 values = append (values ,
@@ -278,11 +278,11 @@ func ArrowValuesToProtoValues(arr arrow.Array) ([]*types.Value, error) {
278278 values = append (values ,
279279 & types.Value {Val : & types.Value_StringVal {StringVal : arr .(* array.String ).Value (idx )}})
280280 }
281- case arrow .FixedWidthTypes .Time64ns :
281+ case arrow .FixedWidthTypes .Time32s :
282282 for idx := 0 ; idx < arr .Len (); idx ++ {
283283 values = append (values ,
284284 & types.Value {Val : & types.Value_UnixTimestampVal {
285- UnixTimestampVal : int64 (arr .(* array.Time64 ).Value (idx ))}})
285+ UnixTimestampVal : int64 (arr .(* array.Time32 ).Value (idx ))}})
286286 }
287287 default :
288288 return nil , fmt .Errorf ("unsupported arrow to proto conversion for type %s" , arr .DataType ())
0 commit comments