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

feat: supports CTE query #1674

Merged
merged 2 commits into from
May 30, 2023
Merged

Conversation

killme2008
Copy link
Contributor

@killme2008 killme2008 commented May 30, 2023

I hereby agree to the terms of the GreptimeDB CLA

What's changed and what's your intention?

Supports CTE query, for example:

with cte1 as (select i as j from a), cte2 as (select ref.j as k from cte1 as ref), cte3 as (select ref2.j+1 as i from cte1 as ref2) select * from cte2 union all select * FROM cte3 order by 1;

+----+
| k  |
+----+
| 42 |
| 43 |
+----+

Main changes:

  • Remove the duplicate timestamp constraint in Schema.
  • If the table is not found, don't throw an error when resolving tables in the SQL planner.
  • Adds some CTE test cases.

TODO:

  • Some queries are not supported by datafusion, we can create some issues to track them.

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.

Close #1315

@killme2008 killme2008 marked this pull request as ready for review May 30, 2023 10:34
@codecov
Copy link

codecov bot commented May 30, 2023

Codecov Report

Merging #1674 (8194d55) into develop (a4b8844) will decrease coverage by 0.31%.
The diff coverage is 100.00%.

❗ Current head 8194d55 differs from pull request most recent head ec97a4b. Consider uploading reports for the commit ec97a4b to get more accurate results

@@             Coverage Diff             @@
##           develop    #1674      +/-   ##
===========================================
- Coverage    85.77%   85.46%   -0.31%     
===========================================
  Files          572      572              
  Lines        91735    91741       +6     
===========================================
- Hits         78685    78411     -274     
- Misses       13050    13330     +280     

Copy link
Contributor

@v0y4g3r v0y4g3r left a comment

Choose a reason for hiding this comment

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

LGTM

@killme2008 killme2008 enabled auto-merge (squash) May 30, 2023 11:54
@killme2008 killme2008 merged commit 00104be into GreptimeTeam:develop May 30, 2023
paomian pushed a commit to paomian/greptimedb that referenced this pull request Oct 19, 2023
* feat: supports CTE query

* test: move cte test to standalone
@killme2008 killme2008 deleted the feat/support-cte branch January 16, 2024 09: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
3 participants