hcrosse opened a new pull request, #3830: URL: https://github.com/apache/iceberg-rust/pull/3830
## Which issue does this PR close? - Closes #3829. ## What changes are included in this PR? When a Parquet column's primitive type does not match or promote cleanly to the Iceberg table schema (for example, a Parquet `TIMESTAMP(MICROS)` column read under a `timestamp_ns` or `timestamptz_ns` field), field-ID projection previously omitted the leaf silently. That caused multi-column reads to fill optional columns with NULLs while single-column reads fell back to `ProjectionMask::all()` and cast the column anyway. - Return `ErrorKind::DataInvalid` from field-ID and name-mapped projection when a requested leaf has an invalid primitive type promotion, instead of silently dropping it. - Skip unrequested sibling leaves (such as struct presence leaves) during the mismatch check so they do not trigger false rejections. - Allow Iceberg v3 primitive promotions from unknown to any primitive type and from date to microsecond or nanosecond timestamps in `type_promotion_is_valid`, while preserving unknown leaves so nested containers keep their validity. Note that position-based fallback reads (files with neither embedded field IDs nor a name mapping) remain unchanged, and overflow enforcement on `Date` to `TimestampNs` casts in `RecordBatchTransformer` is left to #3623 to avoid cross-PR conflicts. ## Are these changes tested? Yes. I added unit and end-to-end Parquet reader tests covering invalid primitive mismatches across top-level and nested columns, `TIMESTAMP(MICROS)` under `timestamp_ns` and `timestamptz_ns` with embedded field IDs and name mappings, nested unknown validity preservation, unknown promotion, presence leaves, and missing evolved columns. ## AI Disclosure I used AI coding tools to help draft the code, tests and this description. I reviewed the changes, ran the checks locally, and can explain the design. -- 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]
