@@ -56,6 +56,7 @@ use datafusion::prelude::Expr;
56
56
use pbjson_types:: Any as ProtoAny ;
57
57
use substrait:: proto:: exchange_rel:: { ExchangeKind , RoundRobin , ScatterFields } ;
58
58
use substrait:: proto:: expression:: cast:: FailureBehavior ;
59
+ use substrait:: proto:: expression:: field_reference:: { RootReference , RootType } ;
59
60
use substrait:: proto:: expression:: literal:: interval_day_to_second:: PrecisionMode ;
60
61
use substrait:: proto:: expression:: literal:: map:: KeyValue ;
61
62
use substrait:: proto:: expression:: literal:: {
@@ -70,7 +71,6 @@ use substrait::proto::rel_common::EmitKind::Emit;
70
71
use substrait:: proto:: {
71
72
rel_common, ExchangeRel , ExpressionReference , ExtendedExpression , RelCommon ,
72
73
} ;
73
- use substrait:: proto:: expression:: field_reference:: { RootReference , RootType } ;
74
74
use substrait:: {
75
75
proto:: {
76
76
aggregate_function:: AggregationInvocation ,
@@ -2151,7 +2151,7 @@ fn try_to_substrait_field_reference(
2151
2151
} ) ,
2152
2152
) ) ,
2153
2153
} ) ) ,
2154
- root_type : Some ( RootType :: RootReference ( RootReference { } ) ) ,
2154
+ root_type : Some ( RootType :: RootReference ( RootReference { } ) ) ,
2155
2155
} )
2156
2156
}
2157
2157
_ => substrait_err ! ( "Expect a `Column` expr, but found {expr:?}" ) ,
@@ -2193,7 +2193,7 @@ fn substrait_field_ref(index: usize) -> Result<Expression> {
2193
2193
} ) ,
2194
2194
) ) ,
2195
2195
} ) ) ,
2196
- root_type : Some ( RootType :: RootReference ( RootReference { } ) ) ,
2196
+ root_type : Some ( RootType :: RootReference ( RootReference { } ) ) ,
2197
2197
} ) ) ) ,
2198
2198
} )
2199
2199
}
@@ -2424,18 +2424,16 @@ mod test {
2424
2424
Ok ( ( ) )
2425
2425
}
2426
2426
2427
-
2428
2427
#[ 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 ) ?;
2431
2430
2432
2431
match & expression. rex_type {
2433
2432
Some ( RexType :: Selection ( field_ref) ) => {
2434
2433
assert_ne ! ( field_ref. root_type, None ) ;
2435
-
2436
- } ,
2434
+ }
2437
2435
2438
- _ => assert ! ( false ) ,
2436
+ _ => panic ! ( "Should not be anything other than field reference" ) ,
2439
2437
}
2440
2438
Ok ( ( ) )
2441
2439
}
0 commit comments