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: allow cross-schema query in promql #3545

Merged

Conversation

sunng87
Copy link
Member

@sunng87 sunng87 commented Mar 19, 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?

This patch adds special matcher __schema__ for our promql parser for selecting a schema where the table sits. This allows user to do cross-schema query in promql.

The patch also does some refactoring in promql parser.

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.

@github-actions github-actions bot added the docs-not-required This change does not impact docs. label Mar 19, 2024
Copy link

codecov bot commented Mar 19, 2024

Codecov Report

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

Project coverage is 85.06%. Comparing base (14267c2) to head (d2be785).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3545      +/-   ##
==========================================
- Coverage   85.40%   85.06%   -0.34%     
==========================================
  Files         931      931              
  Lines      154826   154941     +115     
==========================================
- Hits       132224   131800     -424     
- Misses      22602    23141     +539     

@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 Mar 19, 2024
@sunng87 sunng87 force-pushed the feature/schema-selector-for-promql branch from 8b8f5b4 to b4bfc98 Compare March 20, 2024 04:30
@sunng87
Copy link
Member Author

sunng87 commented Mar 21, 2024

Updated

@sunng87
Copy link
Member Author

sunng87 commented Mar 22, 2024

@waynexia PTAL

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.

Looking good. Would prefer to also add some sqlness test

@sunng87
Copy link
Member Author

sunng87 commented Mar 27, 2024

Do we have sqlness for promql? I didn't see them so I added tests in tests-integration.

@killme2008
Copy link
Contributor

Do we have sqlness for promql? I didn't see them so I added tests in tests-integration.

Rerfer to https://github.com/GreptimeTeam/greptimedb/tree/main/tests/cases/standalone/common/tql

@waynexia waynexia enabled auto-merge March 29, 2024 07:30
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 Mar 29, 2024
Merged via the queue into GreptimeTeam:main with commit 500f9f1 Mar 29, 2024
19 checks passed
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