mbutrovich commented on code in PR #3683:
URL: https://github.com/apache/iceberg-rust/pull/3683#discussion_r4743581851


##########
crates/iceberg/Cargo.toml:
##########
@@ -73,6 +73,7 @@ parquet = { workspace = true, features = [
   "geospatial",
 ] }
 parquet-geospatial = { workspace = true }
+parquet-variant-compute = { workspace = true }

Review Comment:
   > Should variant reading sit behind a cargo feature?
   
   I'd keep it ungated. The Iceberg spec stores a Parquet variant with the 
[Variant shredding 
encoding](https://github.com/apache/iceberg/blob/65d832d7a8da4dc33ae8eb5e0b249c49c5b61301/format/spec.md?plain=1#L1938),
 and that spec 
[says](https://github.com/apache/parquet-format/blob/5baa8669703fb887f8a0127678f66582800e25bc/VariantShredding.md?plain=1#L43)
 "When `typed_value` is present, readers **must** reconstruct shredded values". 
A reader doesn't choose whether a writer shredded. iceberg-java shreds when a 
table or a write sets 
[`write.parquet.shred-variants`](https://github.com/apache/iceberg/blob/65d832d7a8da4dc33ae8eb5e0b249c49c5b61301/core/src/main/java/org/apache/iceberg/TableProperties.java#L161-L162).
 With the feature off, the same v3 table would read or fail depending on a 
compile flag in the consumer, and the error would come from each file's read, 
as it does on `main` 
[today](https://github.com/apache/iceberg-rust/blob/3cef7b693e53a3f8c31c9ee1172de298546a8969/crates/iceber
 g/src/arrow/schema.rs#L136-L144).
   
   The added crates are already in the graphs of the main consumers. Against 
`main`, `cargo tree -p iceberg -e normal` adds `arrow`, `arrow-row`, 
`parquet-variant`, `parquet-variant-json`, and `parquet-variant-compute`. 
DataFusion [depends on 
`arrow`](https://github.com/apache/datafusion/blob/a62e7817b22e7b4efa00800eafb76a9ed2200513/Cargo.toml#L80),
 which always brings `arrow-row`. Comet turns on parquet's [`experimental` 
feature](https://github.com/apache/datafusion-comet/blob/07caef5f7f0ab4e3caf407f2779d35165785769d/native/Cargo.toml#L47),
 which [pulls 
in](https://github.com/apache/arrow-rs/blob/5e2595eac90f715c07ea602e46b1ae21b40b8891/parquet/Cargo.toml#L125)
 the variant crates. `pyiceberg-core` [depends on 
`arrow`](https://github.com/apache/iceberg-rust/blob/3cef7b693e53a3f8c31c9ee1172de298546a8969/bindings/python/Cargo.toml#L37).
 arrow-rs 
[releases](https://github.com/apache/arrow-rs/blob/5e2595eac90f715c07ea602e46b1ae21b40b8891/Cargo.toml#L89-L91)
 the variant crates together wi
 th `parquet`, so they move in the same upgrade PR, and none of their types 
appear in `iceberg`'s public API.
   
   `iceberg` also has [no cargo 
features](https://github.com/apache/iceberg-rust/blob/f50381e503e9a1a407add9fd44583c96c0ca134d/crates/iceberg/Cargo.toml#L32-L33)
 today. A feature would need `cfg` branches in projection, the transformer, and 
the INT96 coercion, and CI runs for both settings.



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