Skip to content

feat: PromQL binary expr planner#889

Merged
waynexia merged 4 commits intoGreptimeTeam:developfrom
waynexia:prom-bin-op-plan
Jan 29, 2023
Merged

feat: PromQL binary expr planner#889
waynexia merged 4 commits intoGreptimeTeam:developfrom
waynexia:prom-bin-op-plan

Conversation

@waynexia
Copy link
Copy Markdown
Member

@waynexia waynexia commented Jan 17, 2023

Signed-off-by: Ruihang Xia waynestxia@gmail.com

I hereby agree to the terms of the GreptimeDB CLA

What's changed and what's your intention?

Plan PromQL Binary expression to datafusion LogicalPlan. Plan and expression are mixed in PromQL, so translating this part might not be very straightforward:

  • Literals should be processed separately because they are not plan in DF.
  • Binary ops on columns are translated to an INNER JOIN ON TIME INDEX, with operator applied to each value-column.

Checklist

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

Refer to a related PR or issue link (optional)

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
@waynexia waynexia marked this pull request as ready for review January 28, 2023 08:32
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 28, 2023

Codecov Report

Merging #889 (9459626) into develop (1e9d090) will decrease coverage by 0.18%.
The diff coverage is 87.20%.

@@             Coverage Diff             @@
##           develop     #889      +/-   ##
===========================================
- Coverage    86.32%   86.15%   -0.18%     
===========================================
  Files          425      427       +2     
  Lines        57005    57793     +788     
===========================================
+ Hits         49209    49789     +580     
- Misses        7796     8004     +208     
Flag Coverage Δ
rust 86.15% <87.20%> (-0.18%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/promql/src/planner.rs 87.97% <87.20%> (+0.64%) ⬆️
src/object-store/src/test_util.rs 0.00% <0.00%> (-100.00%) ⬇️
src/common/time/src/error.rs 47.82% <0.00%> (-52.18%) ⬇️
src/servers/src/auth.rs 33.33% <0.00%> (-38.10%) ⬇️
src/datanode/src/instance.rs 49.76% <0.00%> (-16.11%) ⬇️
src/table/src/predicate.rs 84.41% <0.00%> (-12.72%) ⬇️
tests-integration/src/test_util.rs 87.55% <0.00%> (-11.99%) ⬇️
src/storage/src/chunk.rs 91.37% <0.00%> (-8.63%) ⬇️
src/storage/src/sst.rs 88.88% <0.00%> (-5.74%) ⬇️
src/servers/src/auth/user_provider.rs 79.88% <0.00%> (-5.31%) ⬇️
... and 33 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Comment thread src/promql/src/planner.rs Outdated
Comment thread src/promql/src/planner.rs Outdated
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
Copy link
Copy Markdown
Member

@killme2008 killme2008 left a comment

Choose a reason for hiding this comment

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

LGTM

@waynexia waynexia merged commit 71482b3 into GreptimeTeam:develop Jan 29, 2023
@waynexia waynexia deleted the prom-bin-op-plan branch January 29, 2023 09:02
@waynexia waynexia mentioned this pull request Jan 30, 2023
26 tasks
@waynexia waynexia added this to the v0.1 milestone Feb 15, 2023
paomian pushed a commit to paomian/greptimedb that referenced this pull request Oct 19, 2023
* feat: PromQL binary expr planner

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* column & column test

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* column & literal test

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* mark literal-literal unsupported

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

---------

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
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.

4 participants