voonhous opened a new pull request, #20326:
URL: https://github.com/apache/hudi/pull/20326

   ### Describe the issue this Pull Request addresses
   
   Addresses the write side of #19442. `Spark4VariantShreddingProvider` mapped 
an Avro `fixed` `typed_value` leaf to Spark's `BinaryType`, so shredding 
emitted a `ByteBuffer` where parquet-avro needs a `GenericFixed` 
(`ClassCastException` at write) and never checked the fixed size. A `uuid` 
logical type on `fixed(16)` emitted a `String` (`UnresolvedUnionException`).
   
   ### Summary and Changelog
   
   - `avroTypeToScalarType` returns `null` for a plain `fixed` leaf and for 
`uuid` on `fixed`, so the value is not shredded and stays in the residual 
`value`. Same pattern as the existing millisecond-timestamp decline.
   - Decimal on `fixed` is unchanged: the decimal logical-type check runs first.
   - `TestSpark4VariantShreddingProvider`: `fixedLeafIsNotShredded` (plain 
`fixed(4)` and uuid on `fixed(16)`), plus a decimal-on-`fixed` case in 
`decimalLeafShredsToBigDecimal`. `fixedLeafIsNotShredded` fails on master.
   
   ### Impact
   
   Only reachable with a hand-declared Avro schema that has a `fixed` 
`typed_value`; the shredding DDL and inference never produce one. Such values 
now land in the residual instead of failing the write.
   
   ### Risk Level
   
   low
   
   <details><summary>Out of scope</summary>
   
   The read-side cases mapped in 
https://github.com/apache/hudi/issues/19442#issuecomment-6165989504 (DECIMAL on 
INT32 / INT64, TIME, TIMESTAMP(NANOS) and TIMESTAMP(MILLIS) from files written 
by other engines) are not changed here.
   
   </details>
   
   ### Documentation Update
   
   none
   
   ### Contributor's checklist
   
   - [x] Read through [contributor's 
guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [x] Enough context is provided in the sections above
   - [x] Adequate tests were added if applicable
   


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