Skip to content

Commit

Permalink
update test to follow upstream
Browse files Browse the repository at this point in the history
fix: align to upstream changes and pass all tests#
  • Loading branch information
Sevenannn committed Dec 26, 2024
1 parent 6ebb5b7 commit fb9fc72
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sources/sql/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1004,10 +1004,10 @@ mod tests {
"SELECT COUNT(CASE WHEN a > 0 THEN a ELSE 0 END) FROM app_table",
r#"SELECT count(CASE WHEN (remote_table.a > 0) THEN remote_table.a ELSE 0 END) FROM remote_table"#,
),
// different tables in single aggregation expression
// // different tables in single aggregation expression
(
"SELECT COUNT(CASE WHEN app_table.a > 0 THEN app_table.a ELSE foo.df_table.a END) FROM app_table, foo.df_table",
r#"SELECT count(CASE WHEN (remote_table.a > 0) THEN remote_table.a ELSE remote_table.a END) FROM remote_table JOIN remote_table ON true"#,
"SELECT COUNT(CASE WHEN appt.a > 0 THEN appt.a ELSE dft.a END) FROM app_table as appt, foo.df_table as dft",
"SELECT count(CASE WHEN (appt.a > 0) THEN appt.a ELSE dft.a END) FROM remote_table AS appt JOIN remote_table AS dft"
),
];

Expand Down Expand Up @@ -1079,12 +1079,12 @@ mod tests {
) -> Result<(), datafusion::error::DataFusionError> {
let data_frame = ctx.sql(sql_query).await?;

println!("before optimization: \n{:#?}", data_frame.logical_plan());
// println!("before optimization: \n{:#?}", data_frame.logical_plan());

let mut known_rewrites = HashMap::new();
let rewritten_plan = rewrite_table_scans(data_frame.logical_plan(), &mut known_rewrites)?;

println!("rewritten_plan: \n{:#?}", rewritten_plan);
// println!("rewritten_plan: \n{:#?}", rewritten_plan);

let unparsed_sql = plan_to_sql(&rewritten_plan)?;

Expand Down

0 comments on commit fb9fc72

Please sign in to comment.