rdblue commented on code in PR #11904: URL: https://github.com/apache/iceberg/pull/11904#discussion_r1925898084
########## parquet/src/main/java/org/apache/iceberg/parquet/ParquetValueReaders.java: ########## @@ -850,4 +919,42 @@ private TripleIterator<?> firstNonNullColumn(List<TripleIterator<?>> columns) { return NullReader.NULL_COLUMN; } } + + private static class RecordReader<T extends StructLike> extends StructReader<T, T> { + private final GenericRecord template; + + private RecordReader( + List<Type> types, List<ParquetValueReader<?>> readers, Types.StructType struct) { + super(types, readers); + this.template = struct != null ? GenericRecord.create(struct) : null; + } + + @Override + protected T newStructData(T reuse) { + if (reuse != null) { + return reuse; + } else { + // GenericRecord.copy() is more performant then GenericRecord.create(StructType) since + // NAME_MAP_CACHE access + // is eliminated. Using copy here to gain performance. Review Comment: Can you fix the formatting of this comment since it has moved? -- 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