-
Notifications
You must be signed in to change notification settings - Fork 715
perf: disable repartition when sort by timestamp desc #3918
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
Conversation
WalkthroughThis update involves significant changes, primarily focused on modifying function signatures to incorporate additional parameters, such as sorting options, and refactoring import statements for clarity. Notable updates include a revised handling of file group splitting based on CPU configuration and adjustments to DataFusion context preparation. Changes also extend to dependency upgrades, specifically in Changes
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 (3)
- src/service/promql/search/grpc/storage.rs (1 hunks)
- src/service/promql/search/grpc/wal.rs (2 hunks)
- src/service/search/datafusion/exec.rs (10 hunks)
Files skipped from review due to trivial changes (1)
- src/service/promql/search/grpc/storage.rs
Additional context used
Path-based instructions (2)
src/service/promql/search/grpc/wal.rs (1)
Pattern
**/*.rs: You are a smart rustlang pull request reviewer.
You are going to review all the rustlang files.
Be concise, and add a brief explanation to your suggestionsMake sure the responses are not too verbose and keep the suggestions to the point i.e. actionable.
src/service/search/datafusion/exec.rs (1)
Pattern
**/*.rs: You are a smart rustlang pull request reviewer.
You are going to review all the rustlang files.
Be concise, and add a brief explanation to your suggestionsMake sure the responses are not too verbose and keep the suggestions to the point i.e. actionable.
Additional comments not posted (5)
src/service/promql/search/grpc/wal.rs (1)
190-191: LGTM! The function call update is correct.The addition of the empty array
&[]as an argument in theregister_tablefunction call is appropriate.src/service/search/datafusion/exec.rs (4)
118-118: LGTM! The function call update is correct.The addition of the
&sql.meta.order_byparameter in theregister_tablefunction call is appropriate.
1217-1218: LGTM! The function signature update is correct.The addition of the
sort_by_timestamp_descparameter in theprepare_datafusion_contextfunction signature is appropriate.
1125-1128: LGTM! The function signature update is correct.The addition of the
sort_by_timestamp_descparameter in thecreate_session_configfunction signature is appropriate.
1268-1274: LGTM! The function signature update is correct.The addition of the
sort_keyparameter in theregister_tablefunction signature is appropriate.
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: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- src/handler/http/request/search/mod.rs (1 hunks)
- src/handler/http/request/search/multi_streams.rs (1 hunks)
- src/service/search/datafusion/exec.rs (10 hunks)
Files skipped from review due to trivial changes (2)
- src/handler/http/request/search/mod.rs
- src/handler/http/request/search/multi_streams.rs
Additional context used
Path-based instructions (1)
src/service/search/datafusion/exec.rs (1)
Pattern
**/*.rs: You are a smart rustlang pull request reviewer.
You are going to review all the rustlang files.
Be concise, and add a brief explanation to your suggestionsMake sure the responses are not too verbose and keep the suggestions to the point i.e. actionable.
Additional comments not posted (4)
src/service/search/datafusion/exec.rs (4)
Line range hint
1125-1142:
LGTM! Changes align with the PR objective.The changes to include the
sort_by_timestamp_descparameter and conditionally disable repartition and batch coalescing look good.
1218-1220: LGTM! Changes align with the PR objective.The changes to include the
sort_by_timestamp_descparameter and pass it tocreate_session_configlook good.
1269-1280: LGTM! Changes align with the PR objective.The changes to include the
sort_keyparameter and determine if sorting by timestamp in descending order is needed look good.
122-127: LGTM! But verify the new parameter usage.The change to include the
sort_by_timestamp_descparameter in theprepare_datafusion_contextfunction call looks good.However, ensure that all function calls to
prepare_datafusion_contextin the codebase match the new signature.Verification successful
To ensure all calls to
prepare_datafusion_contextmatch the new signature, let's extract the relevant lines from the mentioned files and verify their correctness.
All calls to
prepare_datafusion_contextmatch the new signature.The
sort_by_timestamp_descparameter has been correctly integrated into all relevant function calls.
src/service/search/datafusion/exec.rssrc/service/promql/search/grpc/wal.rsScripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `prepare_datafusion_context` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type rust $'prepare_datafusion_context'Length of output: 934
Script:
#!/bin/bash # Extract lines with `prepare_datafusion_context` function definition and calls to verify the new signature. # Extract function definition and calls in `src/service/search/datafusion/exec.rs` rg --type rust --context 5 'prepare_datafusion_context' src/service/search/datafusion/exec.rs # Extract function definition and calls in `src/service/promql/search/grpc/wal.rs` rg --type rust --context 5 'prepare_datafusion_context' src/service/promql/search/grpc/wal.rsLength of output: 3452
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/service/search/datafusion/table_provider/mod.rs (3 hunks)
Additional context used
Path-based instructions (1)
src/service/search/datafusion/table_provider/mod.rs (1)
Pattern
**/*.rs: You are a smart rustlang pull request reviewer.
You are going to review all the rustlang files.
Be concise, and add a brief explanation to your suggestionsMake sure the responses are not too verbose and keep the suggestions to the point i.e. actionable.
Additional comments not posted (4)
src/service/search/datafusion/table_provider/mod.rs (4)
37-37: Import statement is necessary for new functionality.The
get_configimport is required for retrieving CPU configuration in the newly added logic.
252-264: New logic for splitting file groups based on CPU number is appropriate.The logic aligns with the PR objective of improving performance by optimizing partitioning based on available CPU resources.
342-381: Functionsplit_groups_by_cpu_numeffectively splits file groups based on CPU number.The function uses a straightforward even-odd strategy to split larger groups into smaller ones until the desired number of partitions is achieved.
383-394: Functionfind_max_group_indexcorrectly identifies the group with the most files.The function is a necessary helper for
split_groups_by_cpu_numto determine which group to split next.
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/service/search/datafusion/table_provider/mod.rs (3 hunks)
Files skipped from review as they are similar to previous changes (1)
- src/service/search/datafusion/table_provider/mod.rs
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/service/search/datafusion/exec.rs (10 hunks)
Files skipped from review as they are similar to previous changes (1)
- src/service/search/datafusion/exec.rs
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 (6)
- .github/workflows/unit-tests.yml (1 hunks)
- Cargo.toml (1 hunks)
- rust-toolchain.toml (1 hunks)
- src/config/Cargo.toml (1 hunks)
- src/service/search/datafusion/exec.rs (10 hunks)
- src/service/search/datafusion/table_provider/mod.rs (2 hunks)
Files skipped from review due to trivial changes (4)
- .github/workflows/unit-tests.yml
- Cargo.toml
- rust-toolchain.toml
- src/config/Cargo.toml
Files skipped from review as they are similar to previous changes (2)
- src/service/search/datafusion/exec.rs
- src/service/search/datafusion/table_provider/mod.rs
Summary by CodeRabbit
Chores
.github/workflows/unit-tests.ymlandrust-toolchain.toml.Dependencies
serdeversion inCargo.toml.gxhashversion specification insrc/config/Cargo.toml.Internal Improvements