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: PromQL handler in query engine #861

Merged
merged 6 commits into from
Jan 11, 2023

Conversation

waynexia
Copy link
Member

@waynexia waynexia commented Jan 10, 2023

I hereby agree to the terms of the GreptimeDB CLA

What's changed and what's your intention?

Implement other missing parts to make an EvalStmt executable by our query engine.

You can get the following result by ceil(demo{host="host1"}) (mocked) after this patch!

+---------------------+----------------+-------------------+
| ts                  | ceil(demo.cpu) | ceil(demo.memory) |
+---------------------+----------------+-------------------+
| 1970-01-01T00:00:00 | 67             | 1024              |
| 1970-01-01T00:00:05 | 67             | 4096              |
| 1970-01-01T00:00:10 | 100            | 20480             |
| 1970-01-01T00:00:50 | 12424          | 1334              |
| 1970-01-01T00:01:20 | 0              | 2334              |
| 1970-01-01T00:01:40 | 49             | 3334              |
+---------------------+----------------+-------------------+

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)

#596

@waynexia waynexia changed the title Promql handler feat: PromQL handler in query engine Jan 10, 2023
@codecov
Copy link

codecov bot commented Jan 10, 2023

Codecov Report

Merging #861 (89ff0c7) into develop (9428e70) will increase coverage by 0.27%.
The diff coverage is 96.99%.

@@             Coverage Diff             @@
##           develop     #861      +/-   ##
===========================================
+ Coverage    86.09%   86.36%   +0.27%     
===========================================
  Files          421      422       +1     
  Lines        55549    55668     +119     
===========================================
+ Hits         47823    48079     +256     
+ Misses        7726     7589     -137     
Flag Coverage Δ
rust 86.36% <96.99%> (+0.27%) ⬆️

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

Impacted Files Coverage Δ
src/promql/src/error.rs 7.69% <ø> (ø)
src/promql/src/extension_plan/planner.rs 81.25% <81.25%> (ø)
src/query/src/query_engine/state.rs 86.53% <94.11%> (+1.48%) ⬆️
src/datanode/src/instance/sql.rs 80.76% <100.00%> (+0.33%) ⬆️
src/promql/src/planner.rs 87.77% <100.00%> (+1.02%) ⬆️
src/query/src/datafusion.rs 96.71% <100.00%> (+0.63%) ⬆️
src/query/src/parser.rs 95.45% <100.00%> (+4.15%) ⬆️
src/table/src/metadata.rs 97.27% <100.00%> (+0.01%) ⬆️
src/object-store/src/test_util.rs 0.00% <0.00%> (-100.00%) ⬇️
src/datanode/src/instance.rs 50.00% <0.00%> (-15.87%) ⬇️
... and 12 more

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

Signed-off-by: Ruihang Xia <[email protected]>
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

@waynexia waynexia merged commit a9b42b4 into GreptimeTeam:develop Jan 11, 2023
@waynexia waynexia deleted the promql-handler branch January 11, 2023 03:31
@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
* example promql test

Signed-off-by: Ruihang Xia <[email protected]>

* make the mock test works

Signed-off-by: Ruihang Xia <[email protected]>

* update planner test

Signed-off-by: Ruihang Xia <[email protected]>

* fix clippys

Signed-off-by: Ruihang Xia <[email protected]>

* add license header

Signed-off-by: Ruihang Xia <[email protected]>

Signed-off-by: Ruihang Xia <[email protected]>
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.

3 participants