@@ -2257,7 +2257,8 @@ mod tests {
2257
2257
// verify that the plan correctly casts u8 to i64
2258
2258
// the cast from u8 to i64 for literal will be simplified, and get lit(int64(5))
2259
2259
// the cast here is implicit so has CastOptions with safe=true
2260
- let expected = "BinaryExpr { left: Column { name: \" c7\" , index: 2 }, op: Lt, right: Literal { value: Int64(5) }, fail_on_overflow: false }" ;
2260
+ let expected = r#"BinaryExpr { left: Column { name: "c7", index: 2 }, op: Lt, right: Literal { value: Int64(5), field: Field { name: "5", data_type: Int64, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} } }, fail_on_overflow: false }"# ;
2261
+
2261
2262
assert ! ( format!( "{exec_plan:?}" ) . contains( expected) ) ;
2262
2263
Ok ( ( ) )
2263
2264
}
@@ -2282,7 +2283,7 @@ mod tests {
2282
2283
& session_state,
2283
2284
) ;
2284
2285
2285
- 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]] })"# ;
2286
+ 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), field: Field { name: "NULL", data_type: Utf8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} } } , "c1"), (Literal { value: Int64(NULL), field: Field { name: "NULL", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} } } , "c2"), (Literal { value: Int64(NULL), field: Field { name: "NULL", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} } }, "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]] })"# ;
2286
2287
2287
2288
assert_eq ! ( format!( "{cube:?}" ) , expected) ;
2288
2289
@@ -2309,7 +2310,7 @@ mod tests {
2309
2310
& session_state,
2310
2311
) ;
2311
2312
2312
- 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]] })"# ;
2313
+ 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), field: Field { name: "NULL", data_type: Utf8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} } } , "c1"), (Literal { value: Int64(NULL), field: Field { name: "NULL", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} } } , "c2"), (Literal { value: Int64(NULL), field: Field { name: "NULL", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} } }, "c3")], groups: [[true, true, true], [false, true, true], [false, false, true], [false, false, false]] })"# ;
2313
2314
2314
2315
assert_eq ! ( format!( "{rollup:?}" ) , expected) ;
2315
2316
@@ -2493,7 +2494,7 @@ mod tests {
2493
2494
let execution_plan = plan ( & logical_plan) . await ?;
2494
2495
// verify that the plan correctly adds cast from Int64(1) to Utf8, and the const will be evaluated.
2495
2496
2496
- 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 }" ;
2497
+ let expected = "expr: [(BinaryExpr { left: BinaryExpr { left: Column { name: \" c1\" , index: 0 }, op: Eq, right: Literal { value: Utf8(\" a\" ), field: Field { name: \" a \" , data_type: Utf8, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} } } , fail_on_overflow: false }, op: Or, right: BinaryExpr { left: Column { name: \" c1\" , index: 0 }, op: Eq, right: Literal { value: Utf8(\" 1\" ), field: Field { name: \" 1 \" , data_type: Utf8, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} } }, fail_on_overflow: false }, fail_on_overflow: false }" ;
2497
2498
2498
2499
let actual = format ! ( "{execution_plan:?}" ) ;
2499
2500
assert ! ( actual. contains( expected) , "{}" , actual) ;
0 commit comments