-
Notifications
You must be signed in to change notification settings - Fork 314
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
refactor: split match arms in prom_expr_to_plan into smaller methods #4317
Conversation
Signed-off-by: Ruihang Xia <[email protected]>
WalkthroughThe Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- src/query/src/promql/planner.rs (1 hunks)
Additional comments not posted (10)
src/query/src/promql/planner.rs (10)
172-174
: Verify delegation to new functions.The
prom_expr_to_plan
function correctly delegates to the new functions for handling specific PromQL expressions. Ensure that all new functions (prom_aggr_expr_to_plan
,prom_unary_expr_to_plan
, etc.) are implemented correctly and integrated properly.Also applies to: 182-193
196-230
: Ensure correct processing of aggregate expressions.The
prom_aggr_expr_to_plan
function correctly processes the components of the aggregate expression and builds a logical plan. Verify that the group expressions and aggregate expressions are handled correctly, and the plan is built as expected.
232-243
: Ensure correct processing of unary expressions.The
prom_unary_expr_to_plan
function correctly processes the unary expression and builds a logical plan with the-
operator. Verify that the function handles the-
operator as expected and integrates correctly with the overall plan.
245-445
: Ensure correct processing of binary expressions.The
prom_binary_expr_to_plan
function correctly processes the components of the binary expression and builds a logical plan. Verify that the function handles literals, columns, and binary operators as expected, and integrates correctly with the overall plan.
448-469
: Ensure correct processing of number literals.The
prom_number_lit_to_plan
function correctly processes the number literal and builds a logical plan with the literal expression. Verify that the function handles the literal expression as expected and integrates correctly with the overall plan.
471-492
: Ensure correct processing of string literals.The
prom_string_lit_to_plan
function correctly processes the string literal and builds a logical plan with the literal expression. Verify that the function handles the literal expression as expected and integrates correctly with the overall plan.
494-524
: Ensure correct processing of vector selectors.The
prom_vector_selector_to_plan
function correctly processes the vector selector components and builds a logical plan. Verify that the function handles matchers, normalization, and manipulation as expected, and integrates correctly with the overall plan.
526-565
: Ensure correct processing of matrix selectors.The
prom_matrix_selector_to_plan
function correctly processes the matrix selector components and builds a logical plan. Verify that the function handles vector selectors, normalization, and manipulation as expected, and integrates correctly with the overall plan.
567-615
: Ensure correct processing of function calls.The
prom_call_expr_to_plan
function correctly processes the function call components and builds a logical plan. Verify that the function handles special functions and function arguments as expected, and integrates correctly with the overall plan.
617-657
: Ensure correct processing of extension expressions.The
prom_ext_expr_to_plan
function correctly processes the extension expression components and builds a logical plan. Verify that the function handles explain and analyze operations as expected, and integrates correctly with the overall plan.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4317 +/- ##
==========================================
- Coverage 85.13% 84.85% -0.29%
==========================================
Files 1060 1060
Lines 187669 187648 -21
==========================================
- Hits 159777 159226 -551
- Misses 27892 28422 +530 |
It works on my machine🤩
After this PR:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DLJB
The script to compute stack size: https://wiki.waynest.com/#/page/gdb%20compute%20stack%20size |
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?
No logic changes. Breakdown
prom_expr_to_plan
into several small functions.Stack size in debug mode after this patch:
Link to the issue for the third time 😣 : rust-lang/rust#34283
Summary by CodeRabbit