@@ -115,7 +115,7 @@ impl TryFrom<&DataType> for protobuf::ArrowType {
115115 }
116116}
117117
118- impl TryFrom < & DataType > for protobuf :: arrow_type :: ArrowTypeEnum {
118+ impl TryFrom < & DataType > for ArrowTypeEnum {
119119 type Error = Error ;
120120
121121 fn try_from ( val : & DataType ) -> Result < Self , Self :: Error > {
@@ -439,9 +439,7 @@ impl TryFrom<&ScalarValue> for protobuf::ScalarValue {
439439 } )
440440 }
441441 None => Ok ( protobuf:: ScalarValue {
442- value : Some ( protobuf:: scalar_value:: Value :: NullValue (
443- ( & data_type) . try_into ( ) ?,
444- ) ) ,
442+ value : Some ( Value :: NullValue ( ( & data_type) . try_into ( ) ?) ) ,
445443 } ) ,
446444 } ,
447445 ScalarValue :: Decimal64 ( val, p, s) => match * val {
@@ -457,9 +455,7 @@ impl TryFrom<&ScalarValue> for protobuf::ScalarValue {
457455 } )
458456 }
459457 None => Ok ( protobuf:: ScalarValue {
460- value : Some ( protobuf:: scalar_value:: Value :: NullValue (
461- ( & data_type) . try_into ( ) ?,
462- ) ) ,
458+ value : Some ( Value :: NullValue ( ( & data_type) . try_into ( ) ?) ) ,
463459 } ) ,
464460 } ,
465461 ScalarValue :: Decimal128 ( val, p, s) => match * val {
@@ -475,9 +471,7 @@ impl TryFrom<&ScalarValue> for protobuf::ScalarValue {
475471 } )
476472 }
477473 None => Ok ( protobuf:: ScalarValue {
478- value : Some ( protobuf:: scalar_value:: Value :: NullValue (
479- ( & data_type) . try_into ( ) ?,
480- ) ) ,
474+ value : Some ( Value :: NullValue ( ( & data_type) . try_into ( ) ?) ) ,
481475 } ) ,
482476 } ,
483477 ScalarValue :: Decimal256 ( val, p, s) => match * val {
@@ -493,9 +487,7 @@ impl TryFrom<&ScalarValue> for protobuf::ScalarValue {
493487 } )
494488 }
495489 None => Ok ( protobuf:: ScalarValue {
496- value : Some ( protobuf:: scalar_value:: Value :: NullValue (
497- ( & data_type) . try_into ( ) ?,
498- ) ) ,
490+ value : Some ( Value :: NullValue ( ( & data_type) . try_into ( ) ?) ) ,
499491 } ) ,
500492 } ,
501493 ScalarValue :: Date64 ( val) => {
@@ -788,8 +780,8 @@ impl From<&Precision<usize>> for protobuf::Precision {
788780 }
789781}
790782
791- impl From < & Precision < datafusion_common :: ScalarValue > > for protobuf:: Precision {
792- fn from ( s : & Precision < datafusion_common :: ScalarValue > ) -> protobuf:: Precision {
783+ impl From < & Precision < ScalarValue > > for protobuf:: Precision {
784+ fn from ( s : & Precision < ScalarValue > ) -> protobuf:: Precision {
793785 match s {
794786 Precision :: Exact ( val) => protobuf:: Precision {
795787 precision_info : protobuf:: PrecisionInfo :: Exact . into ( ) ,
@@ -1076,16 +1068,14 @@ impl TryFrom<&JsonOptions> for protobuf::JsonOptions {
10761068
10771069/// Creates a scalar protobuf value from an optional value (T), and
10781070/// encoding None as the appropriate datatype
1079- fn create_proto_scalar < I , T : FnOnce ( & I ) -> protobuf :: scalar_value :: Value > (
1071+ fn create_proto_scalar < I , T : FnOnce ( & I ) -> Value > (
10801072 v : Option < & I > ,
10811073 null_arrow_type : & DataType ,
10821074 constructor : T ,
10831075) -> Result < protobuf:: ScalarValue , Error > {
10841076 let value = v
10851077 . map ( constructor)
1086- . unwrap_or ( protobuf:: scalar_value:: Value :: NullValue (
1087- null_arrow_type. try_into ( ) ?,
1088- ) ) ;
1078+ . unwrap_or ( Value :: NullValue ( null_arrow_type. try_into ( ) ?) ) ;
10891079
10901080 Ok ( protobuf:: ScalarValue { value : Some ( value) } )
10911081}
@@ -1141,35 +1131,25 @@ fn encode_scalar_nested_value(
11411131
11421132 match val {
11431133 ScalarValue :: List ( _) => Ok ( protobuf:: ScalarValue {
1144- value : Some ( protobuf :: scalar_value :: Value :: ListValue ( scalar_list_value) ) ,
1134+ value : Some ( Value :: ListValue ( scalar_list_value) ) ,
11451135 } ) ,
11461136 ScalarValue :: LargeList ( _) => Ok ( protobuf:: ScalarValue {
1147- value : Some ( protobuf:: scalar_value:: Value :: LargeListValue (
1148- scalar_list_value,
1149- ) ) ,
1137+ value : Some ( Value :: LargeListValue ( scalar_list_value) ) ,
11501138 } ) ,
11511139 ScalarValue :: FixedSizeList ( _) => Ok ( protobuf:: ScalarValue {
1152- value : Some ( protobuf:: scalar_value:: Value :: FixedSizeListValue (
1153- scalar_list_value,
1154- ) ) ,
1140+ value : Some ( Value :: FixedSizeListValue ( scalar_list_value) ) ,
11551141 } ) ,
11561142 ScalarValue :: ListView ( _) => Ok ( protobuf:: ScalarValue {
1157- value : Some ( protobuf:: scalar_value:: Value :: ListViewValue (
1158- scalar_list_value,
1159- ) ) ,
1143+ value : Some ( Value :: ListViewValue ( scalar_list_value) ) ,
11601144 } ) ,
11611145 ScalarValue :: LargeListView ( _) => Ok ( protobuf:: ScalarValue {
1162- value : Some ( protobuf:: scalar_value:: Value :: LargeListViewValue (
1163- scalar_list_value,
1164- ) ) ,
1146+ value : Some ( Value :: LargeListViewValue ( scalar_list_value) ) ,
11651147 } ) ,
11661148 ScalarValue :: Struct ( _) => Ok ( protobuf:: ScalarValue {
1167- value : Some ( protobuf:: scalar_value:: Value :: StructValue (
1168- scalar_list_value,
1169- ) ) ,
1149+ value : Some ( Value :: StructValue ( scalar_list_value) ) ,
11701150 } ) ,
11711151 ScalarValue :: Map ( _) => Ok ( protobuf:: ScalarValue {
1172- value : Some ( protobuf :: scalar_value :: Value :: MapValue ( scalar_list_value) ) ,
1152+ value : Some ( Value :: MapValue ( scalar_list_value) ) ,
11731153 } ) ,
11741154 _ => unreachable ! ( ) ,
11751155 }
0 commit comments