-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[parquet] Avoid a clone while resolving the read strategy #9056
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -110,19 +110,13 @@ impl ReadPlanBuilder { | |
| None => return RowSelectionStrategy::Selectors, | ||
| }; | ||
|
|
||
| let trimmed = selection.clone().trim(); | ||
| let selectors: Vec<RowSelector> = trimmed.into(); | ||
| if selectors.is_empty() { | ||
| return RowSelectionStrategy::Mask; | ||
| } | ||
|
|
||
| let total_rows: usize = selectors.iter().map(|s| s.row_count).sum(); | ||
| let selector_count = selectors.len(); | ||
| if selector_count == 0 { | ||
| let non_empty_selector_count = selection.iter().filter(|s| s.row_count > 0).count(); | ||
|
||
| let total_rows: usize = selection.iter().map(|s| s.row_count).sum(); | ||
| if non_empty_selector_count == 0 { | ||
| return RowSelectionStrategy::Mask; | ||
| } | ||
|
|
||
| if total_rows < selector_count.saturating_mul(threshold) { | ||
| if total_rows < non_empty_selector_count.saturating_mul(threshold) { | ||
| RowSelectionStrategy::Mask | ||
| } else { | ||
| RowSelectionStrategy::Selectors | ||
|
|
||
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.
this clone shows up in the traces for some of the clickbench queries. I think this is because there are 9000 selectors for these queries