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: support evaluate expr in range query param #3823

Merged
merged 4 commits into from
May 17, 2024

Conversation

Taylor-lagrange
Copy link
Contributor

@Taylor-lagrange Taylor-lagrange commented Apr 28, 2024

I hereby agree to the terms of the GreptimeDB CLA.

Refer to a related PR or issue link (optional)

What's changed and what's your intention?

Support use expr can be evaluate at logical plan stage (e.g. INTERVAL '2' day - INTERVAL '1' day)

Support case like:

SELECT
    ts, 
    min(val) RANGE (now() - (now() - INTERVAL '2' day + INTERVAL '1' day)) 
FROM 
    host
ALIGN
    (now() - (now() - INTERVAL '2' day + INTERVAL '1' day)) 
TO 
    (now() - (now() + INTERVAL '1' hour)) 
by (1) 
ORDER BY ts;

Please explain IN DETAIL what the changes are in this PR and why they are needed:

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.
  • This PR does not require documentation updates.

@Taylor-lagrange Taylor-lagrange requested review from evenyag and a team as code owners April 28, 2024 07:00
@github-actions github-actions bot added the docs-not-required This change does not impact docs. label Apr 28, 2024
Copy link

codecov bot commented Apr 28, 2024

Codecov Report

Attention: Patch coverage is 87.30159% with 16 lines in your changes are missing coverage. Please review.

Project coverage is 85.66%. Comparing base (6ab3aeb) to head (a30de61).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3823      +/-   ##
==========================================
- Coverage   86.00%   85.66%   -0.34%     
==========================================
  Files         963      963              
  Lines      164516   164627     +111     
==========================================
- Hits       141489   141029     -460     
- Misses      23027    23598     +571     

@github-actions github-actions bot added docs-required This change requires docs update. and removed docs-not-required This change does not impact docs. labels Apr 29, 2024
src/query/src/range_select/plan_rewrite.rs Outdated Show resolved Hide resolved
src/query/src/range_select/plan_rewrite.rs Show resolved Hide resolved
src/query/src/range_select/plan_rewrite.rs Outdated Show resolved Hide resolved
@killme2008
Copy link
Contributor

@waynexia Please take a look.

Copy link
Member

@waynexia waynexia left a comment

Choose a reason for hiding this comment

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

🚀

@waynexia waynexia added this pull request to the merge queue May 17, 2024
Merged via the queue into GreptimeTeam:main with commit e2a1cb5 May 17, 2024
21 checks passed
WenyXu pushed a commit to WenyXu/greptimedb that referenced this pull request May 21, 2024
* feat: support evaluate expr in range query param

* chore: fix comment

* chore: fix code comment

* fix: disbale now in duration param
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-required This change requires docs update.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants