M-Tesla opened a new pull request, #11017:
URL: https://github.com/apache/arrow-rs/pull/11017

   # Which issue does this PR close?
   
   - Closes #10941.
   
   # Rationale for this change
   
   parquet-format [GH-607](https://github.com/apache/parquet-format/pull/606) 
says readers must handle unknown physical and logical type combinations (for 
example INT32 annotated as UUID) by treating them as an unknown logical type: 
expose the physical type, no annotation, ignore statistics.
   
   This crate currently errors in `Type` construction (`Cannot annotate Uuid 
from INT32`). @alamb asked for a reader option rather than changing the default.
   
   # What changes are included in this PR?
   
   - Default behavior is unchanged: incompatible combinations still error.
   - New option `with_coerce_incompatible_logical_types(true)` on 
`ArrowReaderOptions`, `ReadOptionsBuilder`, and `ParquetMetaDataOptions`.
   - With the option, the column is read as its physical type with no logical 
annotation. Column-chunk statistics for those columns are skipped.
   - Writer-side `Type::build()` still rejects the combination. Round-trip of 
the invalid annotation is out of scope, as noted in the issue.
   - Malformed known annotations (UUID on FLBA of the wrong length, List on a 
primitive) still error even with the option.
   
   # Are these changes tested?
   
   - Schema parse: INT32+UUID errors by default, coerces to INT32 with the 
option, UUID FLBA(15) and List-on-primitive still error with the option.
   - End to end: write INT32 values with a UUID annotation, default reader 
errors, option reads `Int32` `[1, 2, 3]` and drops statistics.
   
   `cargo test -p parquet --lib` (1378 passed). `cargo clippy -p parquet 
--all-targets -- -D warnings`.
   
   # Are there any user-facing changes?
   
   Additive reader option. Default remains an error. No breaking API change.
   
   # AI Disclosure
   
   Assisted with the option plumbing, GH-607 coerce path, and regression tests. 
Default stays an error per the issue discussion. Reviewed and verified with the 
checks above.
   
   Made with [Cursor](https://cursor.com)


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

Reply via email to