You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/11/24 11:27:26 UTC

[GitHub] [arrow-rs] tustvold opened a new pull request, #3175: Bloom filter config tweaks (#3023)

tustvold opened a new pull request, #3175:
URL: https://github.com/apache/arrow-rs/pull/3175

   # 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.
   -->
   
   Part of #3023
   
   # 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 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 `breaking 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@arrow.apache.org

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


[GitHub] [arrow-rs] ursabot commented on pull request #3175: Bloom filter config tweaks (#3023)

Posted by GitBox <gi...@apache.org>.
ursabot commented on PR #3175:
URL: https://github.com/apache/arrow-rs/pull/3175#issuecomment-1326472639

   Benchmark runs are scheduled for baseline = 4b9e3fee2878401b141c17a7ac3767cc3fa6c06f and contender = eefbdce229eb355bbdfd5ccbc24247be882fda15. eefbdce229eb355bbdfd5ccbc24247be882fda15 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ec2-t3-xlarge-us-east-2] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/eab08c8408f04cc8b0b5b4acbf669f2e...9e5719c1a72741e1b2581c8c521af9b0/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on test-mac-arm] [test-mac-arm](https://conbench.ursa.dev/compare/runs/01f3235713f644f995dfe716d3971228...9314c546045d459aa459d711dda0f3f4/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-i9-9960x] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/586c2d4f179744c9af185c1a97e0a89a...91f6d360c6ea44beb8ed2964dd1a9f94/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-thinkcentre-m75q] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/fc40d47ff308459cb07a35139dfb8b3b...6f933371849d4e5cbdd57e9953efc572/)
   Buildkite builds:
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
   test-mac-arm: Supported benchmark langs: C++, Python, R
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


-- 
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@arrow.apache.org

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


[GitHub] [arrow-rs] tustvold merged pull request #3175: Bloom filter config tweaks (#3023)

Posted by GitBox <gi...@apache.org>.
tustvold merged PR #3175:
URL: https://github.com/apache/arrow-rs/pull/3175


-- 
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@arrow.apache.org

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


[GitHub] [arrow-rs] tustvold commented on a diff in pull request #3175: Bloom filter config tweaks (#3023)

Posted by GitBox <gi...@apache.org>.
tustvold commented on code in PR #3175:
URL: https://github.com/apache/arrow-rs/pull/3175#discussion_r1031405061


##########
parquet/src/column/writer/encoder.rs:
##########
@@ -194,17 +194,10 @@ impl<T: DataType> ColumnValueEncoder for ColumnValueEncoderImpl<T> {
 
         let statistics_enabled = props.statistics_enabled(descr.path());
 
-        let bloom_filter_enabled = props.bloom_filter_enabled(descr.path());
-        let bloom_filter =
-            if let Some(BloomFilterProperties { ndv, fpp }) = bloom_filter_enabled {
-                Sbbf::new_with_ndv_fpp(ndv, fpp)
-                    .map_err(|e| {
-                        eprintln!("invalid bloom filter properties: {}", e);
-                    })
-                    .ok()
-            } else {
-                None
-            };
+        let bloom_filter = props
+            .bloom_filter_properties(descr.path())
+            .map(|props| Sbbf::new_with_ndv_fpp(*ndv, *fpp))
+            .transpose()?;

Review Comment:
   It is better to propagate the error than printing it



##########
parquet/src/file/properties.rs:
##########
@@ -672,40 +673,37 @@ impl ColumnProperties {
     /// otherwise it is a no-op.
     /// If `value` is `false`, resets bloom filter properties to `None`.
     fn set_bloom_filter_enabled(&mut self, value: bool) {
-        if value {
-            self.bloom_filter_enabled = self
-                .bloom_filter_enabled()
-                .or_else(|| Some(Default::default()));
-        } else {
-            self.bloom_filter_enabled = None;
+        if value && self.bloom_filter_properies.is_none() {
+            self.bloom_filter_properies = Some(Default::default())
+        } else if !value {
+            self.bloom_filter_properies = None
         }
     }
 
     /// Sets the false positive probability for bloom filter for this column, and implicitly enables
-    /// bloom filter if not previously enabled. If the `value` is not between 0 and 1 exclusive, it is
-    /// discarded as no-op.
+    /// bloom filter if not previously enabled.
+    ///
+    /// # Panics

Review Comment:
   Better IMO to fail loud than silently



##########
parquet/src/file/properties.rs:
##########
@@ -260,16 +260,17 @@ impl WriterProperties {
             .unwrap_or(DEFAULT_MAX_STATISTICS_SIZE)
     }
 
-    /// Returns whether bloom filter is enabled for a given column. Bloom filter can be enabled over
-    /// all or for a specific column, and is by default set to be disabled.
-    pub fn bloom_filter_enabled(
+    /// Returns the [`BloomFilterProperties`] for the given column
+    ///
+    /// Returns `None` if bloom filter is disabled
+    pub fn bloom_filter_properties(
         &self,
         col: &ColumnPath,
-    ) -> Option<BloomFilterProperties> {
+    ) -> Option<&BloomFilterProperties> {

Review Comment:
   Generally it is better to return a reference so that callers can clone only if necessary



##########
parquet/src/file/properties.rs:
##########
@@ -260,16 +260,17 @@ impl WriterProperties {
             .unwrap_or(DEFAULT_MAX_STATISTICS_SIZE)
     }
 
-    /// Returns whether bloom filter is enabled for a given column. Bloom filter can be enabled over
-    /// all or for a specific column, and is by default set to be disabled.
-    pub fn bloom_filter_enabled(
+    /// Returns the [`BloomFilterProperties`] for the given column
+    ///
+    /// Returns `None` if bloom filter is disabled
+    pub fn bloom_filter_properties(

Review Comment:
   Given this returns `BloomFilterProperties` and not a boolean, I thought this name was more appropriate



-- 
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@arrow.apache.org

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