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(sql): fix order by column resolution #3426

Merged
merged 7 commits into from
Jun 7, 2023

Conversation

bziobrowski
Copy link
Contributor

@bziobrowski bziobrowski commented May 30, 2023

Fixes #3419
Fixes #3433

Fixes resolution of non-aliased references of column with an alias in ORDER BY clause .

Examples:

CREATE TABLE tst ( ts timestamp ) timestamp(ts);

SELECT ts AS ref0 
FROM tst
GROUP BY ts <-- non-aliased reference
ORDER BY ts

SELECT DISTINCT tst.ts AS ref0
FROM tst
WHERE (tst.ts) IS NOT NULL 
GROUP BY tst.ts
ORDER BY tst.ts

@ideoma
Copy link
Collaborator

ideoma commented Jun 7, 2023

[PR Coverage check]

😍 pass : 51 / 55 (92.73%)

file detail

path covered line new line coverage
🔵 io/questdb/griffin/SqlOptimiser.java 51 55 92.73%

@bluestreak01 bluestreak01 merged commit cb397cb into master Jun 7, 2023
21 checks passed
@bluestreak01 bluestreak01 deleted the bz_fix_order_by_column_resolution branch June 7, 2023 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants