Skip to content
New issue

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

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

Already on GitHub? # to your account

[MINOR]: Fix Optimize Projections Bug #8992

Merged
merged 1 commit into from
Jan 26, 2024
Merged

[MINOR]: Fix Optimize Projections Bug #8992

merged 1 commit into from
Jan 26, 2024

Conversation

mustafasrepo
Copy link
Contributor

@mustafasrepo mustafasrepo commented Jan 25, 2024

Which issue does this PR close?

Closes #8978.

Rationale for this change

Aggregate requires at least one grouping or aggregate expression. In these cases, we do not optimize away all of the aggregate expressions, we keep one aggregate expression. However, because of the place of empty check, we didnot propagate its requirement below. This PR moves this check above so that its requirements can be propagated below.

What changes are included in this PR?

Are these changes tested?

Yes

Are there any user-facing changes?

@github-actions github-actions bot added optimizer Optimizer rules sqllogictest SQL Logic Tests (.slt) labels Jan 25, 2024
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.

Looks good to me -- thank you for the quick fix @mustafasrepo

cc @lewiszlw

@lewiszlw
Copy link
Member

I tested and this works as expected. Thanks!

@mustafasrepo mustafasrepo merged commit 8a4bad4 into apache:main Jan 26, 2024
23 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
optimizer Optimizer rules sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

optimize_projections rule breaks some view operation
3 participants