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`
   
   EDIT: nvm, there isn't any direct relation between the Avro and Parquet 
internal readers, so having different naming here should be fine



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

Reply via email to