Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: unify replace count(*) analyzer by removing it in sql crate #6660

Merged
merged 1 commit into from
Jun 14, 2023

Conversation

jackwener
Copy link
Member

@jackwener jackwener commented Jun 13, 2023

Which issue does this PR close?

Closes #.

Rationale for this change

What changes are included in this PR?

  • replace count() analyzer by removing it in sql crate, sql/dataframe all use rule to replace count()
  • fix: CountWildcardRule ignore Expr::Alias

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added core Core DataFusion crate optimizer Optimizer rules sql SQL Planner sqllogictest SQL Logic Tests (.slt) labels Jun 13, 2023
@@ -881,7 +881,7 @@ fn select_aggregate_with_having_referencing_column_not_in_select() {
assert_eq!(
"Plan(\"HAVING clause references non-aggregate values: \
Expression person.first_name could not be resolved from available columns: \
COUNT(UInt8(1))\")",
COUNT(*)\")",
Copy link
Member Author

Choose a reason for hiding this comment

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

sql-crate don't replace count(*).
we use rule to replace unified count(*).

@jackwener jackwener requested a review from alamb June 13, 2023 15:27
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

It makes a lot of sense to me to use a rewrite that is in the optimizer (so it happens as part of any plan, not just SQL plans). Thanks @jackwener

@alamb
Copy link
Contributor

alamb commented Jun 13, 2023

cc @jiangzhx who did some related work on #5518 I think

@jackwener jackwener merged commit 6194d58 into apache:main Jun 14, 2023
@jackwener jackwener deleted the remove_repl branch June 14, 2023 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate optimizer Optimizer rules sql SQL Planner sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants