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 sample by over subquery with explicit timestamp #3186

Merged
merged 3 commits into from
Apr 26, 2023

Conversation

bziobrowski
Copy link
Contributor

@bziobrowski bziobrowski commented Apr 13, 2023

Fixes #3085

Subqueries with explicit timestamp, e.g.

( SELECT * FROM (X) TIMESTAMP(ts) ) 

are normally used because X doesn't produce timestamp metadata . Passing the 'timestamp required flag' down
into inner queries is likely to fail if X looks like :

  SELECT * FROM Y
  UNION ALL
  SELECT * FROM Z 
  ORDER BY ts

@ideoma
Copy link
Collaborator

ideoma commented Apr 26, 2023

[PR Coverage check]

😍 pass : 15 / 15 (100.00%)

file detail

path covered line new line coverage
🔵 io/questdb/griffin/SqlParser.java 1 1 100.00%
🔵 io/questdb/griffin/model/QueryModel.java 5 5 100.00%
🔵 io/questdb/griffin/SqlCodeGenerator.java 6 6 100.00%
🔵 io/questdb/griffin/SqlOptimiser.java 3 3 100.00%

@ideoma ideoma merged commit ac945c4 into master Apr 26, 2023
17 checks passed
@ideoma ideoma deleted the bz_fix_sample_by_vs_explicit_timestamp branch April 26, 2023 17:41
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.

SAMPLE BY on a UNION ALL query returns an error when used in CTE
2 participants