-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat:Support applying parquet bloom filters to StringView columns #12503
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alamb
approved these changes
Sep 18, 2024
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.
Thank you so much @my-vegetable-has-exploded -- this looks really great. I verified the test coverage. 🚀
Comment on lines
+267
to
+272
ScalarValue::Utf8(Some(v)) | ScalarValue::Utf8View(Some(v)) => { | ||
sbbf.check(&v.as_str()) | ||
} | ||
ScalarValue::Binary(Some(v)) | ScalarValue::BinaryView(Some(v)) => { | ||
sbbf.check(v) | ||
} |
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.
I double checked that the tests cover this code like this:
--- a/datafusion/core/src/datasource/physical_plan/parquet/row_group_filter.rs
+++ b/datafusion/core/src/datasource/physical_plan/parquet/row_group_filter.rs
@@ -264,9 +264,12 @@ impl PruningStatistics for BloomFilterStatistics {
.iter()
.map(|value| {
match value {
- ScalarValue::Utf8(Some(v)) | ScalarValue::Utf8View(Some(v)) => {
+ ScalarValue::Utf8(Some(v)) => {
sbbf.check(&v.as_str())
}
+ ScalarValue::Utf8View(Some(v)) => {
+ panic!("String view bloom filter not implemented yet");
+ }
ScalarValue::Binary(Some(v)) | ScalarValue::BinaryView(Some(v)) => {
sbbf.check(v)
}
@@ -1439,6 +1442,7 @@ mod tests {
}
}
+
cargo test -p datafusion -- row_group_filter
running 21 tests
test datasource::physical_plan::parquet::row_group_filter::tests::test_row_group_bloom_filter_pruning_predicate_multiple_expr ... ok
test datasource::physical_plan::parquet::row_group_filter::tests::row_group_pruning_predicate_missing_stats ... ok
test datasource::physical_plan::parquet::row_group_filter::tests::test_row_group_bloom_filter_pruning_predicate_simple_expr ... ok
test datasource::physical_plan::parquet::row_group_filter::tests::test_row_group_bloom_filter_pruning_predicate_sql_in ... ok
test datasource::physical_plan::parquet::row_group_filter::tests::row_group_pruning_predicate_file_schema ... ok
test datasource::physical_plan::parquet::row_group_filter::tests::row_group_pruning_predicate_simple_expr ... ok
test datasource::physical_plan::parquet::row_group_filter::tests::row_group_pruning_predicate_decimal_type2 ... ok
test datasource::physical_plan::parquet::row_group_filter::tests::row_group_pruning_predicate_decimal_type ... ok
test datasource::physical_plan::parquet::row_group_filter::tests::row_group_pruning_predicate_decimal_type3 ... ok
test datasource::physical_plan::parquet::row_group_filter::tests::row_group_pruning_predicate_null_expr ... ok
test datasource::physical_plan::parquet::row_group_filter::tests::row_group_pruning_predicate_partial_expr ... ok
test datasource::physical_plan::parquet::row_group_filter::tests::row_group_pruning_predicate_decimal_type4 ... ok
test datasource::physical_plan::parquet::row_group_filter::tests::row_group_pruning_predicate_decimal_type5 ... ok
test datasource::physical_plan::parquet::row_group_filter::tests::row_group_pruning_predicate_eq_null_expr ... ok
test datasource::physical_plan::parquet::row_group_filter::tests::test_row_group_bloom_filter_pruning_predicate_with_exists_2_values ... ok
test datasource::physical_plan::parquet::row_group_filter::tests::test_row_group_bloom_filter_pruning_predicate_with_exists_3_values ... ok
test datasource::physical_plan::parquet::row_group_filter::tests::test_row_group_bloom_filter_pruning_predicate_with_exists_value ... ok
test datasource::physical_plan::parquet::row_group_filter::tests::test_row_group_bloom_filter_pruning_predicate_with_or_not_eq ... ok
test datasource::physical_plan::parquet::row_group_filter::tests::test_row_group_bloom_filter_pruning_predicate_with_exists_3_values_view ... FAILED
test datasource::physical_plan::parquet::row_group_filter::tests::test_row_group_bloom_filter_pruning_predicate_multiple_expr_view ... FAILED
test datasource::physical_plan::parquet::row_group_filter::tests::test_row_group_bloom_filter_pruning_predicate_without_bloom_filter ... ok
failures:
---- datasource::physical_plan::parquet::row_group_filter::tests::test_row_group_bloom_filter_pruning_predicate_with_exists_3_values_view stdout ----
thread 'datasource::physical_plan::parquet::row_group_filter::tests::test_row_group_bloom_filter_pruning_predicate_with_exists_3_values_view' panicked at datafusion/core/src/datasource/physical_plan/parquet/row_group_filter.rs:271:25:
String bloom filter not implemented yet
---- datasource::physical_plan::parquet::row_group_filter::tests::test_row_group_bloom_filter_pruning_predicate_multiple_expr_view stdout ----
thread 'datasource::physical_plan::parquet::row_group_filter::tests::test_row_group_bloom_filter_pruning_predicate_multiple_expr_view' panicked at datafusion/core/src/datasource/physical_plan/parquet/row_group_filter.rs:271:25:
String bloom filter not implemented yet
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failures:
datasource::physical_plan::parquet::row_group_filter::tests::test_row_group_bloom_filter_pruning_predicate_multiple_expr_view
datasource::physical_plan::parquet::row_group_filter::tests::test_row_group_bloom_filter_pruning_predicate_with_exists_3_values_view
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #12499
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?