@@ -40,9 +40,9 @@ func ProtoTypeToArrowType(sample *types.Value) (arrow.DataType, error) {
40
40
case * types.Value_DoubleListVal :
41
41
return arrow .ListOf (arrow .PrimitiveTypes .Float64 ), nil
42
42
case * types.Value_UnixTimestampVal :
43
- return arrow .FixedWidthTypes .Time64ns , nil
43
+ return arrow .FixedWidthTypes .Time32s , nil
44
44
case * types.Value_UnixTimestampListVal :
45
- return arrow .ListOf (arrow .FixedWidthTypes .Time64ns ), nil
45
+ return arrow .ListOf (arrow .FixedWidthTypes .Time32s ), nil
46
46
default :
47
47
return nil ,
48
48
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) {
80
80
case types .ValueType_DOUBLE_LIST :
81
81
return arrow .ListOf (arrow .PrimitiveTypes .Float64 ), nil
82
82
case types .ValueType_UNIX_TIMESTAMP :
83
- return arrow .FixedWidthTypes .Time64ns , nil
83
+ return arrow .FixedWidthTypes .Time32s , nil
84
84
case types .ValueType_UNIX_TIMESTAMP_LIST :
85
- return arrow .ListOf (arrow .FixedWidthTypes .Time64ns ), nil
85
+ return arrow .ListOf (arrow .FixedWidthTypes .Time32s ), nil
86
86
default :
87
87
return nil ,
88
88
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
119
119
for _ , v := range values {
120
120
fieldBuilder .Append (v .GetDoubleVal ())
121
121
}
122
- case * array.Time64Builder :
122
+ case * array.Time32Builder :
123
123
for _ , v := range values {
124
- fieldBuilder .Append (arrow .Time64 (v .GetUnixTimestampVal ()))
124
+ fieldBuilder .Append (arrow .Time32 (v .GetUnixTimestampVal ()))
125
125
}
126
126
case * array.ListBuilder :
127
127
for _ , list := range values {
@@ -157,9 +157,9 @@ func copyProtoValuesToArrowArray(builder array.Builder, values []*types.Value) e
157
157
for _ , v := range list .GetDoubleListVal ().GetVal () {
158
158
valueBuilder .Append (v )
159
159
}
160
- case * array.Time64Builder :
160
+ case * array.Time32Builder :
161
161
for _ , v := range list .GetUnixTimestampListVal ().GetVal () {
162
- valueBuilder .Append (arrow .Time64 (v ))
162
+ valueBuilder .Append (arrow .Time32 (v ))
163
163
}
164
164
}
165
165
}
@@ -227,10 +227,10 @@ func ArrowValuesToProtoValues(arr arrow.Array) ([]*types.Value, error) {
227
227
}
228
228
values = append (values ,
229
229
& types.Value {Val : & types.Value_BoolListVal {BoolListVal : & types.BoolList {Val : vals }}})
230
- case arrow .FixedWidthTypes .Time64ns :
230
+ case arrow .FixedWidthTypes .Time32s :
231
231
vals := make ([]int64 , int (offsets [idx ])- pos )
232
232
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 ))
234
234
}
235
235
236
236
values = append (values ,
@@ -278,11 +278,11 @@ func ArrowValuesToProtoValues(arr arrow.Array) ([]*types.Value, error) {
278
278
values = append (values ,
279
279
& types.Value {Val : & types.Value_StringVal {StringVal : arr .(* array.String ).Value (idx )}})
280
280
}
281
- case arrow .FixedWidthTypes .Time64ns :
281
+ case arrow .FixedWidthTypes .Time32s :
282
282
for idx := 0 ; idx < arr .Len (); idx ++ {
283
283
values = append (values ,
284
284
& types.Value {Val : & types.Value_UnixTimestampVal {
285
- UnixTimestampVal : int64 (arr .(* array.Time64 ).Value (idx ))}})
285
+ UnixTimestampVal : int64 (arr .(* array.Time32 ).Value (idx ))}})
286
286
}
287
287
default :
288
288
return nil , fmt .Errorf ("unsupported arrow to proto conversion for type %s" , arr .DataType ())
0 commit comments