rdblue commented on code in PR #11904:
URL: https://github.com/apache/iceberg/pull/11904#discussion_r1927618131
##########
parquet/src/main/java/org/apache/iceberg/data/parquet/BaseParquetWriter.java:
##########
@@ -50,6 +54,32 @@ protected ParquetValueWriter<T> createWriter(MessageType
type) {
protected abstract ParquetValueWriters.StructWriter<T> createStructWriter(
List<ParquetValueWriter<?>> writers);
+ protected ParquetValueWriter<?> fixedWriter(ColumnDescriptor desc) {
+ return new FixedWriter(desc);
+ }
+
+ protected ParquetValueWriters.PrimitiveWriter<?> dateWriter(ColumnDescriptor
desc) {
+ return new DateWriter(desc);
+ }
+
+ protected ParquetValueWriters.PrimitiveWriter<?> timeWriter(ColumnDescriptor
desc) {
+ return new TimeWriter(desc);
+ }
+
+ protected ParquetValueWriters.PrimitiveWriter<?> timestampWriter(
+ ColumnDescriptor desc, boolean isAdjustedToUTC) {
+ if (isAdjustedToUTC) {
+ return new TimestamptzWriter(desc);
+ } else {
+ return new TimestampWriter(desc);
+ }
+ }
+
+ protected ParquetValueWriters.PrimitiveWriter<?> uuidWriter(ColumnDescriptor
desc) {
+ // Use primitive-type writer; no special writer needed.
Review Comment:
Okay, I did some digging and it looks like this behavior was accidentally
introduced when moving to the type annotation visitor
(https://github.com/apache/iceberg/commit/1d13a10d4c8a1174083eb81373310b8499f84f44).
Before that point, UUID was not supported but after that it would fall through
to the primitive type and return a writer for bytes.
The problem is that this conflicts with the representation used by the Avro
generic object model:
https://github.com/apache/iceberg/blob/main/core/src/main/java/org/apache/iceberg/avro/ValueReaders.java#L108-L110
I think this change is the right choice because the object models should
match and using UUID for this is well-established in the Avro implementation
and the generic random data generator.
--
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]