Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions dask_planner/src/sql/optimizer/eliminate_agg_distinct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,30 +503,28 @@ mod tests {
.expect("building plan")
}

#[ignore]
#[test]
fn test_single_distinct_group_by() -> Result<()> {
let plan = LogicalPlanBuilder::from(test_table_scan("a"))
.aggregate(vec![col("a")], vec![count_distinct(col("b"))])?
.build()?;

let expected = "Projection: #a.a, #COUNT(a.a) AS COUNT(DISTINCT a.b)\
\n Aggregate: groupBy=[[#a.a]], aggr=[[COUNT(#a.a)]]\
let expected = "Projection: #a.a, #COUNT(a.b) AS COUNT(DISTINCT a.b)\
\n Aggregate: groupBy=[[#a.a]], aggr=[[COUNT(#a.b)]]\
\n Aggregate: groupBy=[[#a.a, #a.b]], aggr=[[]]\
\n TableScan: a";
assert_optimized_plan_eq(&plan, expected);
Ok(())
}

#[ignore]
#[test]
fn test_single_distinct_group_by_with_alias() -> Result<()> {
let plan = LogicalPlanBuilder::from(test_table_scan("a"))
.aggregate(vec![col("a")], vec![count_distinct(col("b")).alias("cd_b")])?
.build()?;

let expected = "Projection: #a.a, #COUNT(a.a) AS cd_b\
\n Aggregate: groupBy=[[#a.a]], aggr=[[COUNT(#a.a)]]\
let expected = "Projection: #a.a, #COUNT(a.b) AS cd_b\
\n Aggregate: groupBy=[[#a.a]], aggr=[[COUNT(#a.b)]]\
\n Aggregate: groupBy=[[#a.a, #a.b]], aggr=[[]]\
\n TableScan: a";
assert_optimized_plan_eq(&plan, expected);
Expand Down