@@ -1666,7 +1666,7 @@ mod tests {
16661666 use crate :: execution:: runtime_env:: RuntimeEnv ;
16671667 use crate :: logical_plan:: plan:: Extension ;
16681668 use crate :: physical_plan:: {
1669- expressions, DisplayFormatType , Partitioning , Statistics ,
1669+ expressions, DisplayFormatType , Partitioning , PhysicalPlanner , Statistics ,
16701670 } ;
16711671 use crate :: prelude:: { SessionConfig , SessionContext } ;
16721672 use crate :: scalar:: ScalarValue ;
@@ -1696,7 +1696,7 @@ mod tests {
16961696 session_state. config . target_partitions = 4 ;
16971697 let planner = DefaultPhysicalPlanner :: default ( ) ;
16981698 // in the test, we should optimize the logical plan first
1699- session_state. optimize ( logical_plan) ?;
1699+ let logical_plan = session_state. optimize ( logical_plan) ?;
17001700 planner
17011701 . create_physical_plan ( & logical_plan, & session_state)
17021702 . await
@@ -1717,8 +1717,9 @@ mod tests {
17171717 let plan = plan ( & logical_plan) . await ?;
17181718
17191719 // verify that the plan correctly casts u8 to i64
1720+ // the cast from u8 to i64 for literal will be simplified, and get lit(int64(5))
17201721 // the cast here is implicit so has CastOptions with safe=true
1721- let expected = "BinaryExpr { left: Column { name: \" c7\" , index: 2 }, op: Lt, right: CastExpr { expr: Literal { value: UInt8 (5) }, cast_type: Int64 " ;
1722+ let expected = "BinaryExpr { left: Column { name: \" c7\" , index: 2 }, op: Lt, right: Literal { value: Int64 (5) } } " ;
17221723 assert ! ( format!( "{:?}" , plan) . contains( expected) ) ;
17231724 Ok ( ( ) )
17241725 }
0 commit comments