@@ -1423,7 +1423,7 @@ fn get_null_physical_expr_pair(
1423
1423
let data_type = physical_expr. data_type ( input_schema) ?;
1424
1424
let null_value: ScalarValue = ( & data_type) . try_into ( ) ?;
1425
1425
1426
- let null_value = Literal :: new ( null_value) ;
1426
+ let null_value = Literal :: from ( null_value) ;
1427
1427
Ok ( ( Arc :: new ( null_value) , physical_name) )
1428
1428
}
1429
1429
@@ -2018,7 +2018,7 @@ mod tests {
2018
2018
// verify that the plan correctly casts u8 to i64
2019
2019
// the cast from u8 to i64 for literal will be simplified, and get lit(int64(5))
2020
2020
// the cast here is implicit so has CastOptions with safe=true
2021
- let expected = "BinaryExpr { left: Column { name: \" c7\" , index: 2 }, op: Lt, right: Literal { value : Int64(5) }, fail_on_overflow: false }" ;
2021
+ let expected = "BinaryExpr { left: Column { name: \" c7\" , index: 2 }, op: Lt, right: Literal { scalar : Int64(5) }, fail_on_overflow: false }" ;
2022
2022
assert ! ( format!( "{exec_plan:?}" ) . contains( expected) ) ;
2023
2023
Ok ( ( ) )
2024
2024
}
@@ -2043,7 +2043,7 @@ mod tests {
2043
2043
& session_state,
2044
2044
) ;
2045
2045
2046
- let expected = r#"Ok(PhysicalGroupBy { expr: [(Column { name: "c1", index: 0 }, "c1"), (Column { name: "c2", index: 1 }, "c2"), (Column { name: "c3", index: 2 }, "c3")], null_expr: [(Literal { value : Utf8(NULL) }, "c1"), (Literal { value : Int64(NULL) }, "c2"), (Literal { value : Int64(NULL) }, "c3")], groups: [[false, false, false], [true, false, false], [false, true, false], [false, false, true], [true, true, false], [true, false, true], [false, true, true], [true, true, true]] })"# ;
2046
+ let expected = r#"Ok(PhysicalGroupBy { expr: [(Column { name: "c1", index: 0 }, "c1"), (Column { name: "c2", index: 1 }, "c2"), (Column { name: "c3", index: 2 }, "c3")], null_expr: [(Literal { scalar : Utf8(NULL) }, "c1"), (Literal { scalar : Int64(NULL) }, "c2"), (Literal { scalar : Int64(NULL) }, "c3")], groups: [[false, false, false], [true, false, false], [false, true, false], [false, false, true], [true, true, false], [true, false, true], [false, true, true], [true, true, true]] })"# ;
2047
2047
2048
2048
assert_eq ! ( format!( "{cube:?}" ) , expected) ;
2049
2049
@@ -2070,7 +2070,7 @@ mod tests {
2070
2070
& session_state,
2071
2071
) ;
2072
2072
2073
- let expected = r#"Ok(PhysicalGroupBy { expr: [(Column { name: "c1", index: 0 }, "c1"), (Column { name: "c2", index: 1 }, "c2"), (Column { name: "c3", index: 2 }, "c3")], null_expr: [(Literal { value : Utf8(NULL) }, "c1"), (Literal { value : Int64(NULL) }, "c2"), (Literal { value : Int64(NULL) }, "c3")], groups: [[true, true, true], [false, true, true], [false, false, true], [false, false, false]] })"# ;
2073
+ let expected = r#"Ok(PhysicalGroupBy { expr: [(Column { name: "c1", index: 0 }, "c1"), (Column { name: "c2", index: 1 }, "c2"), (Column { name: "c3", index: 2 }, "c3")], null_expr: [(Literal { scalar : Utf8(NULL) }, "c1"), (Literal { scalar : Int64(NULL) }, "c2"), (Literal { scalar : Int64(NULL) }, "c3")], groups: [[true, true, true], [false, true, true], [false, false, true], [false, false, false]] })"# ;
2074
2074
2075
2075
assert_eq ! ( format!( "{rollup:?}" ) , expected) ;
2076
2076
@@ -2254,7 +2254,7 @@ mod tests {
2254
2254
let execution_plan = plan ( & logical_plan) . await ?;
2255
2255
// verify that the plan correctly adds cast from Int64(1) to Utf8, and the const will be evaluated.
2256
2256
2257
- let expected = "expr: [(BinaryExpr { left: BinaryExpr { left: Column { name: \" c1\" , index: 0 }, op: Eq, right: Literal { value : Utf8(\" a\" ) }, fail_on_overflow: false }, op: Or, right: BinaryExpr { left: Column { name: \" c1\" , index: 0 }, op: Eq, right: Literal { value : Utf8(\" 1\" ) }, fail_on_overflow: false }, fail_on_overflow: false }" ;
2257
+ let expected = "expr: [(BinaryExpr { left: BinaryExpr { left: Column { name: \" c1\" , index: 0 }, op: Eq, right: Literal { scalar : Utf8(\" a\" ) }, fail_on_overflow: false }, op: Or, right: BinaryExpr { left: Column { name: \" c1\" , index: 0 }, op: Eq, right: Literal { scalar : Utf8(\" 1\" ) }, fail_on_overflow: false }, fail_on_overflow: false }" ;
2258
2258
2259
2259
let actual = format ! ( "{execution_plan:?}" ) ;
2260
2260
assert ! ( actual. contains( expected) , "{}" , actual) ;
0 commit comments