@@ -218,20 +218,25 @@ impl From<protobuf::PrimitiveScalarType> for DataType {
218218 protobuf:: PrimitiveScalarType :: Float64 => DataType :: Float64 ,
219219 protobuf:: PrimitiveScalarType :: Utf8 => DataType :: Utf8 ,
220220 protobuf:: PrimitiveScalarType :: LargeUtf8 => DataType :: LargeUtf8 ,
221+ protobuf:: PrimitiveScalarType :: Binary => DataType :: Binary ,
222+ protobuf:: PrimitiveScalarType :: LargeBinary => DataType :: LargeBinary ,
221223 protobuf:: PrimitiveScalarType :: Date32 => DataType :: Date32 ,
222- protobuf:: PrimitiveScalarType :: TimeMicrosecond => {
223- DataType :: Time64 ( TimeUnit :: Microsecond )
224- }
225- protobuf:: PrimitiveScalarType :: TimeNanosecond => {
224+ protobuf:: PrimitiveScalarType :: Time64 => {
226225 DataType :: Time64 ( TimeUnit :: Nanosecond )
227226 }
227+ protobuf:: PrimitiveScalarType :: TimestampMicrosecond => {
228+ DataType :: Timestamp ( TimeUnit :: Microsecond , None )
229+ }
230+ protobuf:: PrimitiveScalarType :: TimestampNanosecond => {
231+ DataType :: Timestamp ( TimeUnit :: Nanosecond , None )
232+ }
228233 protobuf:: PrimitiveScalarType :: Null => DataType :: Null ,
229234 protobuf:: PrimitiveScalarType :: Decimal128 => DataType :: Decimal128 ( 0 , 0 ) ,
230235 protobuf:: PrimitiveScalarType :: Date64 => DataType :: Date64 ,
231- protobuf:: PrimitiveScalarType :: TimeSecond => {
236+ protobuf:: PrimitiveScalarType :: TimestampSecond => {
232237 DataType :: Timestamp ( TimeUnit :: Second , None )
233238 }
234- protobuf:: PrimitiveScalarType :: TimeMillisecond => {
239+ protobuf:: PrimitiveScalarType :: TimestampMillisecond => {
235240 DataType :: Timestamp ( TimeUnit :: Millisecond , None )
236241 }
237242 protobuf:: PrimitiveScalarType :: IntervalYearmonth => {
@@ -643,15 +648,20 @@ impl TryFrom<&protobuf::PrimitiveScalarType> for ScalarValue {
643648 PrimitiveScalarType :: Float64 => Self :: Float64 ( None ) ,
644649 PrimitiveScalarType :: Utf8 => Self :: Utf8 ( None ) ,
645650 PrimitiveScalarType :: LargeUtf8 => Self :: LargeUtf8 ( None ) ,
651+ PrimitiveScalarType :: Binary => Self :: Binary ( None ) ,
652+ PrimitiveScalarType :: LargeBinary => Self :: LargeBinary ( None ) ,
646653 PrimitiveScalarType :: Date32 => Self :: Date32 ( None ) ,
647- PrimitiveScalarType :: TimeMicrosecond => {
654+ PrimitiveScalarType :: Time64 => Self :: Time64 ( None ) ,
655+ PrimitiveScalarType :: TimestampMicrosecond => {
648656 Self :: TimestampMicrosecond ( None , None )
649657 }
650- PrimitiveScalarType :: TimeNanosecond => Self :: TimestampNanosecond ( None , None ) ,
658+ PrimitiveScalarType :: TimestampNanosecond => {
659+ Self :: TimestampNanosecond ( None , None )
660+ }
651661 PrimitiveScalarType :: Decimal128 => Self :: Decimal128 ( None , 0 , 0 ) ,
652662 PrimitiveScalarType :: Date64 => Self :: Date64 ( None ) ,
653- PrimitiveScalarType :: TimeSecond => Self :: TimestampSecond ( None , None ) ,
654- PrimitiveScalarType :: TimeMillisecond => {
663+ PrimitiveScalarType :: TimestampSecond => Self :: TimestampSecond ( None , None ) ,
664+ PrimitiveScalarType :: TimestampMillisecond => {
655665 Self :: TimestampMillisecond ( None , None )
656666 }
657667 PrimitiveScalarType :: IntervalYearmonth => Self :: IntervalYearMonth ( None ) ,
@@ -749,6 +759,7 @@ impl TryFrom<&protobuf::ScalarValue> for ScalarValue {
749759 )
750760 }
751761 Value :: Date64Value ( v) => Self :: Date64 ( Some ( * v) ) ,
762+ Value :: Time64Value ( v) => Self :: Time64 ( Some ( * v) ) ,
752763 Value :: IntervalYearmonthValue ( v) => Self :: IntervalYearMonth ( Some ( * v) ) ,
753764 Value :: IntervalDaytimeValue ( v) => Self :: IntervalDayTime ( Some ( * v) ) ,
754765 Value :: TimestampValue ( v) => {
@@ -792,6 +803,8 @@ impl TryFrom<&protobuf::ScalarValue> for ScalarValue {
792803
793804 Self :: Dictionary ( Box :: new ( index_type) , Box :: new ( value) )
794805 }
806+ Value :: BinaryValue ( v) => Self :: Binary ( Some ( v. clone ( ) ) ) ,
807+ Value :: LargeBinaryValue ( v) => Self :: LargeBinary ( Some ( v. clone ( ) ) ) ,
795808 } )
796809 }
797810}
@@ -1419,30 +1432,30 @@ fn typechecked_scalar_value_conversion(
14191432 value :
14201433 Some ( protobuf:: scalar_timestamp_value:: Value :: TimeMicrosecondValue ( v) ) ,
14211434 } ) ,
1422- PrimitiveScalarType :: TimeMicrosecond ,
1435+ PrimitiveScalarType :: TimestampMicrosecond ,
14231436 ) => ScalarValue :: TimestampMicrosecond ( Some ( * v) , unwrap_timezone ( timezone) ) ,
14241437 (
14251438 Value :: TimestampValue ( protobuf:: ScalarTimestampValue {
14261439 timezone,
14271440 value :
14281441 Some ( protobuf:: scalar_timestamp_value:: Value :: TimeNanosecondValue ( v) ) ,
14291442 } ) ,
1430- PrimitiveScalarType :: TimeNanosecond ,
1443+ PrimitiveScalarType :: TimestampNanosecond ,
14311444 ) => ScalarValue :: TimestampNanosecond ( Some ( * v) , unwrap_timezone ( timezone) ) ,
14321445 (
14331446 Value :: TimestampValue ( protobuf:: ScalarTimestampValue {
14341447 timezone,
14351448 value : Some ( protobuf:: scalar_timestamp_value:: Value :: TimeSecondValue ( v) ) ,
14361449 } ) ,
1437- PrimitiveScalarType :: TimeSecond ,
1450+ PrimitiveScalarType :: TimestampSecond ,
14381451 ) => ScalarValue :: TimestampSecond ( Some ( * v) , unwrap_timezone ( timezone) ) ,
14391452 (
14401453 Value :: TimestampValue ( protobuf:: ScalarTimestampValue {
14411454 timezone,
14421455 value :
14431456 Some ( protobuf:: scalar_timestamp_value:: Value :: TimeMillisecondValue ( v) ) ,
14441457 } ) ,
1445- PrimitiveScalarType :: TimeMillisecond ,
1458+ PrimitiveScalarType :: TimestampMillisecond ,
14461459 ) => ScalarValue :: TimestampMillisecond ( Some ( * v) , unwrap_timezone ( timezone) ) ,
14471460 ( Value :: Utf8Value ( v) , PrimitiveScalarType :: Utf8 ) => {
14481461 ScalarValue :: Utf8 ( Some ( v. to_owned ( ) ) )
@@ -1469,10 +1482,11 @@ fn typechecked_scalar_value_conversion(
14691482 PrimitiveScalarType :: Utf8 => ScalarValue :: Utf8 ( None ) ,
14701483 PrimitiveScalarType :: LargeUtf8 => ScalarValue :: LargeUtf8 ( None ) ,
14711484 PrimitiveScalarType :: Date32 => ScalarValue :: Date32 ( None ) ,
1472- PrimitiveScalarType :: TimeMicrosecond => {
1485+ PrimitiveScalarType :: Time64 => ScalarValue :: Time64 ( None ) ,
1486+ PrimitiveScalarType :: TimestampMicrosecond => {
14731487 ScalarValue :: TimestampMicrosecond ( None , None )
14741488 }
1475- PrimitiveScalarType :: TimeNanosecond => {
1489+ PrimitiveScalarType :: TimestampNanosecond => {
14761490 ScalarValue :: TimestampNanosecond ( None , None )
14771491 }
14781492 PrimitiveScalarType :: Null => {
@@ -1484,10 +1498,10 @@ fn typechecked_scalar_value_conversion(
14841498 ScalarValue :: Decimal128 ( None , 0 , 0 )
14851499 }
14861500 PrimitiveScalarType :: Date64 => ScalarValue :: Date64 ( None ) ,
1487- PrimitiveScalarType :: TimeSecond => {
1501+ PrimitiveScalarType :: TimestampSecond => {
14881502 ScalarValue :: TimestampSecond ( None , None )
14891503 }
1490- PrimitiveScalarType :: TimeMillisecond => {
1504+ PrimitiveScalarType :: TimestampMillisecond => {
14911505 ScalarValue :: TimestampMillisecond ( None , None )
14921506 }
14931507 PrimitiveScalarType :: IntervalYearmonth => {
@@ -1496,6 +1510,8 @@ fn typechecked_scalar_value_conversion(
14961510 PrimitiveScalarType :: IntervalDaytime => {
14971511 ScalarValue :: IntervalDayTime ( None )
14981512 }
1513+ PrimitiveScalarType :: Binary => ScalarValue :: Binary ( None ) ,
1514+ PrimitiveScalarType :: LargeBinary => ScalarValue :: LargeBinary ( None ) ,
14991515 } ;
15001516 scalar_value
15011517 } else {
0 commit comments