joyhaldar opened a new pull request, #17482:
URL: https://github.com/apache/iceberg/pull/17482

   
[InternalRowConverter](https://github.com/apache/iceberg/blob/main/spark/v4.1/spark/src/test/java/org/apache/iceberg/spark/data/InternalRowConverter.java)
 cast both `FIXED` and `BINARY` to 
[ByteBuffer](https://github.com/apache/iceberg/blob/3c356c45ea00b6ac036684f8b7e24a326c2a55e8/spark/v4.1/spark/src/test/java/org/apache/iceberg/spark/data/InternalRowConverter.java#L83),
 but Iceberg's generic model represents fixed as `byte[]`, leading to 
`ClassCastException`. `FIXED` was 
[excluded](https://github.com/apache/iceberg/blob/3c356c45ea00b6ac036684f8b7e24a326c2a55e8/data/src/test/java/org/apache/iceberg/data/DataGenerators.java#L256)
 from the Spark TCK as a result.
   
   1. `toByteArray` handles both, delegating to 
[ByteBuffers.toByteArray](https://github.com/apache/iceberg/blob/3c356c45ea00b6ac036684f8b7e24a326c2a55e8/api/src/main/java/org/apache/iceberg/util/ByteBuffers.java#L29)
 for the buffer case.
   2. Removes `FIXED` from 
[unsupportedTypeIds()](https://github.com/apache/iceberg/blob/3c356c45ea00b6ac036684f8b7e24a326c2a55e8/spark/v4.1/spark/src/test/java/org/apache/iceberg/spark/data/TestSparkFormatModel.java#L44)
 in Spark `3.5`/`4.0`/`4.1`.
   3. Adds fixed_with_default to 
[DataGenerators.PrimitiveDefaults](https://github.com/apache/iceberg/blob/3c356c45ea00b6ac036684f8b7e24a326c2a55e8/data/src/test/java/org/apache/iceberg/data/DataGenerators.java#L257),
 exercising both branches alongside 
[binary_with_default](https://github.com/apache/iceberg/blob/3c356c45ea00b6ac036684f8b7e24a326c2a55e8/data/src/test/java/org/apache/iceberg/data/DataGenerators.java#L291).
   
   Refs: 
[GenericDataUtil.internalToGeneric](https://github.com/apache/iceberg/blob/3c356c45ea00b6ac036684f8b7e24a326c2a55e8/core/src/main/java/org/apache/iceberg/data/GenericDataUtil.java#L38),
 
[RandomGenericData](https://github.com/apache/iceberg/blob/3c356c45ea00b6ac036684f8b7e24a326c2a55e8/data/src/test/java/org/apache/iceberg/data/RandomGenericData.java#L270).


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