sunchao commented on code in PR #5724:
URL: https://github.com/apache/datafusion-comet/pull/5724#discussion_r3957023828


##########
native/core/src/execution/operators/iceberg_write.rs:
##########
@@ -804,6 +947,107 @@ mod tests {
         assert_eq!(props.created_by(), "Apache Iceberg 1.7.1 (Comet 0.16.0)");
     }
 
+    #[test]
+    fn enables_bloom_filters_only_for_configured_columns() {
+        let mut settings = base_settings();
+        settings.bloom_filter_enabled_columns = vec![
+            "id".to_string(),
+            "tags.list.element".to_string(),
+            "attrs.key_value.value".to_string(),
+        ];
+        let props = build_writer_properties(&settings).unwrap();
+        assert!(props
+            .bloom_filter_properties(&parquet_column_path("id"))
+            .is_some());
+        assert!(props
+            .bloom_filter_properties(&parquet_column_path("tags.list.element"))
+            .is_some());
+        assert!(props
+            
.bloom_filter_properties(&parquet_column_path("attrs.key_value.value"))
+            .is_some());
+        assert!(props
+            .bloom_filter_properties(&parquet_column_path("other"))
+            .is_none());
+    }
+
+    #[test]
+    fn bloom_filter_defaults_match_iceberg() {
+        // Iceberg's documented write-property defaults:
+        // 
https://iceberg.apache.org/docs/latest/configuration/#write-properties
+        let mut settings = base_settings();
+        settings.bloom_filter_enabled_columns = vec!["id".to_string()];
+        let props = build_writer_properties(&settings).unwrap();
+        let bloom = props.bloom_filter_properties(&"id".into()).unwrap();
+        assert_eq!(bloom.fpp, ICEBERG_DEFAULT_BLOOM_FILTER_FPP);
+        assert_eq!(
+            parquet_rs_bloom_filter_bytes(bloom.ndv, bloom.fpp),

Review Comment:
   ### Correctness
   
   [P2] Use the Parquet 59 Bloom API after the rebase
   
   The current lockfile resolves `parquet` 59.3.0, where 
`BloomFilterProperties.fpp` and `.ndv` are private. These three field accesses 
therefore fail with E0616 when the native tests are compiled. Use `bloom.fpp()` 
and `bloom.ndv()`. Also update the new setter at line 685 from 
`set_column_bloom_filter_ndv` to `set_column_bloom_filter_max_ndv`: the old 
name is deprecated since 59.0 and fails the Rust CI action's `-- -D warnings` 
check. Separate-crate projections of the exact upstream API reproduce both 
failures, while getter/current-setter controls compile. Please run the native 
Rust checks after both updates.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to