rdblue commented on code in PR #11904: URL: https://github.com/apache/iceberg/pull/11904#discussion_r1924391656
########## parquet/src/main/java/org/apache/iceberg/parquet/ParquetValueWriters.java: ########## @@ -330,6 +361,37 @@ public void write(int repetitionLevel, CharSequence value) { } } + private static class UUIDWriter extends PrimitiveWriter<UUID> { + private static final ThreadLocal<ByteBuffer> BUFFER = + ThreadLocal.withInitial( + () -> { + ByteBuffer buffer = ByteBuffer.allocate(16); + buffer.order(ByteOrder.BIG_ENDIAN); + return buffer; + }); + + private UUIDWriter(ColumnDescriptor desc) { + super(desc); + } + + @Override + public void write(int repetitionLevel, UUID value) { + ByteBuffer buffer = UUIDUtil.convertToByteBuffer(value, BUFFER.get()); + column.writeBinary(repetitionLevel, Binary.fromReusedByteBuffer(buffer)); + } + } + + public static class RecordWriter<T extends StructLike> extends StructWriter<T> { Review Comment: Rather than adding a public class, can you add a factory method for this? -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org