From e8dd3eadc8a0b800985216a1aa866d5e2e274a93 Mon Sep 17 00:00:00 2001 From: Akhilender Date: Sun, 20 Oct 2024 22:49:06 +0530 Subject: [PATCH] fix: generalize col names1 --- .../src/sql/parse/query_expr_tests.rs | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/crates/proof-of-sql/src/sql/parse/query_expr_tests.rs b/crates/proof-of-sql/src/sql/parse/query_expr_tests.rs index 850742f1c..e39f5f78e 100644 --- a/crates/proof-of-sql/src/sql/parse/query_expr_tests.rs +++ b/crates/proof-of-sql/src/sql/parse/query_expr_tests.rs @@ -1109,15 +1109,15 @@ fn we_can_group_by_without_using_aggregate_functions() { #[test] fn group_by_expressions_are_parsed_before_an_order_by_referencing_an_aggregate_alias_result() { let query_text = - "select max(i) max_sal, i0 d, count(i0) from sxt.t group by i0, i1 order by max_sal"; + "select max(salary) max_sal, department_budget d, count(department_budget) from sxt.employees group by department_budget, project_budget order by max_sal"; - let t = "sxt.t".parse().unwrap(); + let t = "sxt.employees".parse().unwrap(); let accessor = schema_accessor_from_table_ref_with_schema( t, indexmap! { - "i".parse().unwrap() => ColumnType::BigInt, - "i0".parse().unwrap() => ColumnType::BigInt, - "i1".parse().unwrap() => ColumnType::BigInt, + "salary".parse().unwrap() => ColumnType::BigInt, + "department_budget".parse().unwrap() => ColumnType::BigInt, + "project_budget".parse().unwrap() => ColumnType::BigInt, }, ); @@ -1128,20 +1128,20 @@ fn group_by_expressions_are_parsed_before_an_order_by_referencing_an_aggregate_a let expected_query = QueryExpr::new( filter( vec![ - col_expr_plan(t, "i", &accessor), - col_expr_plan(t, "i0", &accessor), - col_expr_plan(t, "i1", &accessor), + col_expr_plan(t, "salary", &accessor), + col_expr_plan(t, "department_budget", &accessor), + col_expr_plan(t, "project_budget", &accessor), ], tab(t), const_bool(true), ), vec![ group_by_postprocessing( - &["i0", "i1"], + &["department_budget", "project_budget"], &[ - aliased_expr(max(col("i")), "max_sal"), - aliased_expr(col("i0"), "d"), - aliased_expr(count(col("i0")), "__count__"), + aliased_expr(max(col("salary")), "max_sal"), + aliased_expr(col("department_budget"), "d"), + aliased_expr(count(col("department_budget")), "__count__"), ], ), orders(&["max_sal"], &[Asc]),