Skip to content

Conversation

@andygrove
Copy link
Contributor

@andygrove andygrove commented Sep 21, 2022

Follows on from #784

let alias = format!("__dask_sql_count__{}", optimizer_config.next_id());
let aggr_expr = vec![count(Expr::Literal(ScalarValue::UInt64(Some(1)))).alias(&alias)];
let expr_name = expr.name()?;
let count_expr = Expr::Column(Column::from_qualified_name(&expr_name));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main fix - COUNT(col) instead of COUNT(1)

@andygrove andygrove changed the title [DF] WIP: Enable distinct agg test [DF] Enable some distinct agg tests Sep 21, 2022
@andygrove andygrove marked this pull request as ready for review September 21, 2022 20:06
a = make_rand_df(
100, a=(int, 50), b=(str, 50), c=(int, 30), d=(str, 40), e=(float, 40)
)
# note that this test repeats the expression `COUNT(DISTINCT a)`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to open an issue to follow up on the dupe case later on?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done: #787

Copy link
Collaborator

@charlesbluca charlesbluca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @andygrove 😄

@charlesbluca charlesbluca merged commit 033d2f4 into dask-contrib:datafusion-sql-planner Sep 21, 2022
@andygrove andygrove deleted the enable-distinct-tests branch September 21, 2022 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants