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

Fix and improve CommonSubexprEliminate rule #10396

Merged
merged 6 commits into from
May 8, 2024
Merged
Changes from 1 commit
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
8 changes: 8 additions & 0 deletions datafusion/sqllogictest/test_files/select.slt
Original file line number Diff line number Diff line change
Expand Up @@ -1613,6 +1613,14 @@ select count(1) from v;
----
1

# Ensure CSE resolves columns correctly
Copy link
Contributor

Choose a reason for hiding this comment

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

I added this test but it still resolves the expr as 1 (not 3) 🤔

# should be 3, not 1
# https://github.com/apache/datafusion/issues/10413
query I
select a + b from (select 1 as a, 2 as b, 1 as "a + b");
----
1

# run below query without logical optimizations
statement ok
set datafusion.optimizer.max_passes=0;
Expand Down