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 PromQL scalar #3693

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

Taylor-lagrange
Copy link
Contributor

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 PromQL scalar function in greptimedb

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

  • Add ScalarCalculate plan in PromQL
  • ScalarCalculate return time series when we only have one time series, or directly return None

After this pr, we can achieve 100% compatibility with node_exporter PromQL queries

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 waynexia and a team as code owners April 11, 2024 02:27
@github-actions github-actions bot added the docs-not-required This change does not impact docs. label Apr 11, 2024
Copy link

codecov bot commented Apr 11, 2024

Codecov Report

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

Project coverage is 85.23%. Comparing base (cfed466) to head (fb0e458).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3693      +/-   ##
==========================================
- Coverage   85.63%   85.23%   -0.40%     
==========================================
  Files         944      945       +1     
  Lines      158776   159259     +483     
==========================================
- Hits       135966   135744     -222     
- Misses      22810    23515     +705     

Copy link
Contributor

@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.

Awesome work!

src/promql/src/extension_plan/scalar_calculate.rs Outdated Show resolved Hide resolved
src/promql/src/extension_plan/scalar_calculate.rs Outdated Show resolved Hide resolved
src/promql/src/planner.rs Outdated Show resolved Hide resolved
src/promql/src/planner.rs Outdated Show resolved Hide resolved
src/promql/src/planner.rs Outdated Show resolved Hide resolved
src/promql/src/planner.rs Outdated Show resolved Hide resolved
src/promql/src/planner.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@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 👍

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.

I doubt the necessity of implementing scalar as a plan. Can Expr fit it?

src/promql/src/planner.rs Outdated Show resolved Hide resolved
src/promql/src/planner.rs Outdated Show resolved Hide resolved
src/promql/src/planner.rs Outdated Show resolved Hide resolved
@Taylor-lagrange Taylor-lagrange force-pushed the feat-promql-scalar branch 2 times, most recently from 6a4000c to 623b6b6 Compare April 17, 2024 08:09
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.

LGTM 🚀

tests-integration/src/tests/promql_test.rs Show resolved Hide resolved
@waynexia waynexia added this pull request to the merge queue Apr 19, 2024
Merged via the queue into GreptimeTeam:main with commit d077892 Apr 19, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-not-required This change does not impact docs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants