You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "lewiszlw (via GitHub)" <gi...@apache.org> on 2024/04/30 06:05:55 UTC

[PR] Split parquet bloom filter config and enable bloom filter on read by default [datafusion]

lewiszlw opened a new pull request, #10306:
URL: https://github.com/apache/datafusion/pull/10306

   ## Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Closes https://github.com/apache/datafusion/issues/10299.
   
   ## Rationale for this change
   
   <!--
    Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.  
   -->
   
   ## What changes are included in this PR?
   
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   ## Are these changes tested?
   
   <!--
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. Serve as another way to document the expected behavior of the code
   
   If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
   -->
   
   ## Are there any user-facing changes?
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!--
   If there are any breaking changes to public APIs, please add the `api change` label.
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Split parquet bloom filter config and enable bloom filter on read by default [datafusion]

Posted by "lewiszlw (via GitHub)" <gi...@apache.org>.
lewiszlw commented on code in PR #10306:
URL: https://github.com/apache/datafusion/pull/10306#discussion_r1585805213


##########
datafusion/core/src/datasource/physical_plan/parquet/mod.rs:
##########
@@ -243,14 +243,32 @@ impl ParquetExec {
     }
 
     /// If enabled, the reader will read by the bloom filter
-    pub fn with_enable_bloom_filter(mut self, enable_bloom_filter: bool) -> Self {
-        self.table_parquet_options.global.bloom_filter_enabled = enable_bloom_filter;
+    pub fn with_enable_bloom_filter_on_read(

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Split parquet bloom filter config and enable bloom filter on read by default [datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #10306:
URL: https://github.com/apache/datafusion/pull/10306#discussion_r1585280851


##########
datafusion/core/src/datasource/physical_plan/parquet/mod.rs:
##########
@@ -243,14 +243,32 @@ impl ParquetExec {
     }
 
     /// If enabled, the reader will read by the bloom filter
-    pub fn with_enable_bloom_filter(mut self, enable_bloom_filter: bool) -> Self {
-        self.table_parquet_options.global.bloom_filter_enabled = enable_bloom_filter;
+    pub fn with_enable_bloom_filter_on_read(

Review Comment:
   I think we can make this a bit shorter:
   
   ```suggestion
       pub fn with_bloom_filter_on_read(
   ```



##########
datafusion/common/src/config.rs:
##########
@@ -395,8 +395,11 @@ config_namespace! {
         /// default parquet writer setting
         pub encoding: Option<String>, default = None
 
-        /// Sets if bloom filter is enabled for any column
-        pub bloom_filter_enabled: bool, default = false
+        /// Sets if bloom filter on read is enabled for any column

Review Comment:
   ```suggestion
           /// Use any available bloom filters when reading parquet files
   ```



##########
datafusion/common/src/config.rs:
##########
@@ -395,8 +395,11 @@ config_namespace! {
         /// default parquet writer setting
         pub encoding: Option<String>, default = None
 
-        /// Sets if bloom filter is enabled for any column
-        pub bloom_filter_enabled: bool, default = false
+        /// Sets if bloom filter on read is enabled for any column
+        pub bloom_filter_on_read_enabled: bool, default = true
+
+        /// Sets if bloom filter on write is enabled for any column

Review Comment:
   ```suggestion
           /// Write bloom filters for all columns when creating parquet files
   ```



##########
datafusion/sqllogictest/test_files/predicates.slt:
##########
@@ -515,7 +515,7 @@ statement ok
 CREATE EXTERNAL TABLE data_index_bloom_encoding_stats STORED AS PARQUET LOCATION '../../parquet-testing/data/data_index_bloom_encoding_stats.parquet';
 
 statement ok
-set datafusion.execution.parquet.bloom_filter_enabled=true;
+set datafusion.execution.parquet.bloom_filter_on_read_enabled=true;

Review Comment:
   It seems like this test was to ensure we had end to end coverage, so now that we switched the default the meaning / coverage has changed
   
   Perhaps we can change it so:
   1. verify the setting with `show datafusion.execution.parquet.bloom_filter_on_read_enabled`
   2. Add a second set of queries with `set datafusion.execution.parquet.bloom_filter_on_read_enabled=false`



##########
datafusion/common/src/config.rs:
##########
@@ -395,8 +395,11 @@ config_namespace! {
         /// default parquet writer setting
         pub encoding: Option<String>, default = None
 
-        /// Sets if bloom filter is enabled for any column
-        pub bloom_filter_enabled: bool, default = false
+        /// Sets if bloom filter on read is enabled for any column
+        pub bloom_filter_on_read_enabled: bool, default = true

Review Comment:
   It seems like `enabled` is somewhat redundant in this option name. Since we are renaming it anyways, what do you think about calling it just `bloom_filter_on_read` and `bloom_filter_on_write`? Something like
   
   ```suggestion
           pub bloom_filter_on_read: bool, default = true
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Split parquet bloom filter config and enable bloom filter on read by default [datafusion]

Posted by "lewiszlw (via GitHub)" <gi...@apache.org>.
lewiszlw commented on code in PR #10306:
URL: https://github.com/apache/datafusion/pull/10306#discussion_r1585805626


##########
datafusion/common/src/config.rs:
##########
@@ -395,8 +395,11 @@ config_namespace! {
         /// default parquet writer setting
         pub encoding: Option<String>, default = None
 
-        /// Sets if bloom filter is enabled for any column
-        pub bloom_filter_enabled: bool, default = false
+        /// Sets if bloom filter on read is enabled for any column
+        pub bloom_filter_on_read_enabled: bool, default = true

Review Comment:
   Shorter name is bettter. Changed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Split parquet bloom filter config and enable bloom filter on read by default [datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #10306:
URL: https://github.com/apache/datafusion/pull/10306


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Split parquet bloom filter config and enable bloom filter on read by default [datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #10306:
URL: https://github.com/apache/datafusion/pull/10306#discussion_r1586213838


##########
datafusion/sqllogictest/test_files/predicates.slt:
##########
@@ -514,8 +517,38 @@ DROP TABLE t;
 statement ok
 CREATE EXTERNAL TABLE data_index_bloom_encoding_stats STORED AS PARQUET LOCATION '../../parquet-testing/data/data_index_bloom_encoding_stats.parquet';
 
+query TT
+SHOW datafusion.execution.parquet.bloom_filter_on_read
+----
+datafusion.execution.parquet.bloom_filter_on_read true
+
+query T
+SELECT * FROM data_index_bloom_encoding_stats WHERE "String" = 'foo';
+----
+
+query T
+SELECT * FROM data_index_bloom_encoding_stats WHERE "String" = 'test';
+----
+test
+
+query T
+SELECT * FROM data_index_bloom_encoding_stats WHERE "String" like '%e%';
+----
+Hello
+test
+are you
+the quick
+over
+the lazy
+
+
+########
+# Test query without bloom filter
+# Refer to https://github.com/apache/datafusion/pull/7821#pullrequestreview-1688062599
+########
+
 statement ok
-set datafusion.execution.parquet.bloom_filter_enabled=true;
+set datafusion.execution.parquet.bloom_filter_on_read=false;

Review Comment:
   👍 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Split parquet bloom filter config and enable bloom filter on read by default [datafusion]

Posted by "lewiszlw (via GitHub)" <gi...@apache.org>.
lewiszlw commented on code in PR #10306:
URL: https://github.com/apache/datafusion/pull/10306#discussion_r1585850535


##########
datafusion/sqllogictest/test_files/predicates.slt:
##########
@@ -515,7 +515,7 @@ statement ok
 CREATE EXTERNAL TABLE data_index_bloom_encoding_stats STORED AS PARQUET LOCATION '../../parquet-testing/data/data_index_bloom_encoding_stats.parquet';
 
 statement ok
-set datafusion.execution.parquet.bloom_filter_enabled=true;
+set datafusion.execution.parquet.bloom_filter_on_read_enabled=true;

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Split parquet bloom filter config and enable bloom filter on read by default [datafusion]

Posted by "hiltontj (via GitHub)" <gi...@apache.org>.
hiltontj commented on PR #10306:
URL: https://github.com/apache/datafusion/pull/10306#issuecomment-2088465983

   Thank you @lewiszlw for taking this one on!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Split parquet bloom filter config and enable bloom filter on read by default [datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #10306:
URL: https://github.com/apache/datafusion/pull/10306#issuecomment-2090270922

   Thanks again @lewiszlw 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org