@@ -56,6 +56,7 @@ use datafusion::prelude::Expr;
5656use pbjson_types:: Any as ProtoAny ;
5757use substrait:: proto:: exchange_rel:: { ExchangeKind , RoundRobin , ScatterFields } ;
5858use substrait:: proto:: expression:: cast:: FailureBehavior ;
59+ use substrait:: proto:: expression:: field_reference:: { RootReference , RootType } ;
5960use substrait:: proto:: expression:: literal:: interval_day_to_second:: PrecisionMode ;
6061use substrait:: proto:: expression:: literal:: map:: KeyValue ;
6162use substrait:: proto:: expression:: literal:: {
@@ -70,7 +71,6 @@ use substrait::proto::rel_common::EmitKind::Emit;
7071use substrait:: proto:: {
7172 rel_common, ExchangeRel , ExpressionReference , ExtendedExpression , RelCommon ,
7273} ;
73- use substrait:: proto:: expression:: field_reference:: { RootReference , RootType } ;
7474use substrait:: {
7575 proto:: {
7676 aggregate_function:: AggregationInvocation ,
@@ -2151,7 +2151,7 @@ fn try_to_substrait_field_reference(
21512151 } ) ,
21522152 ) ) ,
21532153 } ) ) ,
2154- root_type : Some ( RootType :: RootReference ( RootReference { } ) ) ,
2154+ root_type : Some ( RootType :: RootReference ( RootReference { } ) ) ,
21552155 } )
21562156 }
21572157 _ => substrait_err ! ( "Expect a `Column` expr, but found {expr:?}" ) ,
@@ -2193,7 +2193,7 @@ fn substrait_field_ref(index: usize) -> Result<Expression> {
21932193 } ) ,
21942194 ) ) ,
21952195 } ) ) ,
2196- root_type : Some ( RootType :: RootReference ( RootReference { } ) ) ,
2196+ root_type : Some ( RootType :: RootReference ( RootReference { } ) ) ,
21972197 } ) ) ) ,
21982198 } )
21992199}
@@ -2424,18 +2424,16 @@ mod test {
24242424 Ok ( ( ) )
24252425 }
24262426
2427-
24282427 #[ test]
2429- fn to_field_reference ( ) -> Result < ( ) > {
2430- let expression = substrait_field_ref ( 2 ) ? ;
2428+ fn to_field_reference ( ) -> Result < ( ) > {
2429+ let expression = substrait_field_ref ( 2 ) ?;
24312430
24322431 match & expression. rex_type {
24332432 Some ( RexType :: Selection ( field_ref) ) => {
24342433 assert_ne ! ( field_ref. root_type, None ) ;
2435-
2436- } ,
2434+ }
24372435
2438- _ => assert ! ( false ) ,
2436+ _ => panic ! ( "Should not be anything other than field reference" ) ,
24392437 }
24402438 Ok ( ( ) )
24412439 }
0 commit comments