nastra commented on code in PR #14040:
URL: https://github.com/apache/iceberg/pull/14040#discussion_r2371762289
##########
parquet/src/main/java/org/apache/iceberg/data/parquet/InternalReader.java:
##########
@@ -46,11 +52,48 @@ public static <T extends StructLike> ParquetValueReader<T>
create(
return (ParquetValueReader<T>) INSTANCE.createReader(expectedSchema,
fileSchema, idToConstant);
}
+ public static Parquet.ReadBuilder.ReaderFunction readerFunction() {
+ InternalReader<?> reader = new InternalReader<>();
+
+ return new Parquet.ReadBuilder.ReaderFunction() {
+ private Schema schema;
+
+ @Override
+ public Function<MessageType, ParquetValueReader<?>> apply() {
+ return messageType -> reader.createReader(schema, messageType);
+ }
+
+ @Override
+ public Parquet.ReadBuilder.ReaderFunction withSchema(Schema schema) {
+ this.schema = schema;
+ return this;
+ }
+
+ @Override
+ public Parquet.ReadBuilder.ReaderFunction withCustomTypes(
Review Comment:
I actually like this naming you have here better, but just wanted to point
out that in the Avro reader we use `setCustomTypes` / `setRootType` /
`setSchema`
--
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]