mbutrovich opened a new issue, #7827:
URL: https://github.com/apache/datafusion-comet/issues/7827

   ### What is the problem the feature request solves?
   
   #7712 works around two iceberg-rust bugs that drop rows from a data file 
that stores a column with a narrower type than the table (#7138). For each such 
file whose residual has a range, `IN`, or `!=` comparison on an `int`, `long`, 
or `double` column, the native scan reads the footer an extra time and does not 
push that file's residual at all 
([`iceberg_scan.rs`](https://github.com/apache/datafusion-comet/blob/785e961704d7559cf0cc8a2e1a8d3ec600a5e302/native/core/src/execution/operators/iceberg_scan.rs#L210-L240),
 
[`iceberg_narrow_types.rs`](https://github.com/apache/datafusion-comet/blob/785e961704d7559cf0cc8a2e1a8d3ec600a5e302/native/core/src/execution/operators/iceberg_narrow_types.rs)).
 
[`spark.comet.scan.icebergNative.narrowTypeCheck.enabled`](https://github.com/apache/datafusion-comet/blob/785e961704d7559cf0cc8a2e1a8d3ec600a5e302/spark/src/main/scala/org/apache/comet/CometConf.scala#L174-L187)
 turns the check off.
   
   iceberg-rust has fixed both bugs. apache/iceberg-rust#3507 keeps pages whose 
page-index bounds it cannot compare with the predicate. 
apache/iceberg-rust#3540 evaluates the row filter in the table's types instead 
of casting the literal down to the file's type. Comet's current pin, 
apache/iceberg-rust@de0a6ac, has neither. Both need arrow 60, so Comet gets 
them after #7249.
   
   I ran the four `#7138` tests in `CometIcebergNativeSuite` with the check off 
and the `narrow_type_splits` assertions changed to expect 0, on top of #7249:
   
   | iceberg-rust | Includes | Result |
   | --- | --- | --- |
   | apache/iceberg-rust@219078c (the #7249 pin) | #3507 | 3 of 4 fail. `id IN 
(1, 3000000000)` returns no rows and Spark returns `[1, 0.1]`. The multi-page 
test passes. |
   | apache/iceberg-rust@1d4c20a | #3507 and #3540 | 4 of 4 pass |
   
   ### Describe the potential solution
   
   Once Comet's iceberg-rust pin includes apache/iceberg-rust#3540, remove the 
check:
   
   - Delete `iceberg_narrow_types.rs`, the `SharedFooters` `FileIO` that the 
reader shares with it, and the `narrow_type_splits` metric and its entry in 
`metrics.md`.
   - Keep the four `#7138` tests as regression tests for iceberg-rust, without 
the `narrow_type_splits` assertions.
   - Remove the config and its paragraph in the [Iceberg user 
guide](https://github.com/apache/datafusion-comet/blob/785e961704d7559cf0cc8a2e1a8d3ec600a5e302/docs/source/user-guide/latest/iceberg.md?plain=1#L128-L138).
   
   #7712 is on `main` only. No release tag or release branch contains it. If 
the check is removed before 1.3.0 ships, the config never ships, and the 
[versioning 
policy](https://github.com/apache/datafusion-comet/blob/785e961704d7559cf0cc8a2e1a8d3ec600a5e302/docs/source/about/versioning_policy.md?plain=1#L210-L211)
 does not apply. If 1.3.0 ships with it, the key has to stay as a deprecated 
no-op for at least one minor release and be removed in a major release.
   
   ### Additional context
   
   apache/iceberg-rust#3521, which widens promoted page-index bounds to the 
table type, is still open. Until it merges, iceberg-rust keeps every page of a 
promoted column instead of pruning them. The check pushes nothing for those 
files, so removing it does not lose any pruning.
   
   @mixermt, does this match what you saw when writing #7712?
   
   ### Willingness to contribute
   
   I can open the PR once Comet's iceberg-rust pin includes 
apache/iceberg-rust#3540.
   


-- 
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