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

Reduce Schema clones in parquet row filter creation #9

Merged
merged 1 commit into from
Mar 17, 2025

Conversation

alamb
Copy link

@alamb alamb commented Mar 17, 2025

Proposed addition to apache#15263 to reduce Schema clones

@alamb alamb changed the title Reduce Schema clones in predicate Reduce Schema clones in parquet row filter creation Mar 17, 2025
@@ -464,18 +464,15 @@ pub fn build_row_filter(
// `a = 1 AND b = 2 AND c = 3` -> [`a = 1`, `b = 2`, `c = 3`]
let predicates = split_conjunction(expr);

let file_schema = Arc::new(file_schema.clone());
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are deep clones (clone the entire Schema) where as with this PR only the Arc is cloned (ref count incremented)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup makes total sense, I was just cautious to update the signature for build_row_filter since it seems to be a public function.

@adriangb adriangb merged commit 57c5c46 into pydantic:fix-predicate-pushdown-sa Mar 17, 2025
27 checks passed
@alamb alamb deleted the alamb/less_clone branch March 17, 2025 21:00
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.

2 participants