stevenzwu commented on code in PR #14040:
URL: https://github.com/apache/iceberg/pull/14040#discussion_r2335503954


##########
parquet/src/main/java/org/apache/iceberg/data/parquet/InternalReader.java:
##########
@@ -72,4 +91,12 @@ protected ParquetValueReader<?> timeReader(ColumnDescriptor 
desc) {
   protected ParquetValueReader<?> timestampReader(ColumnDescriptor desc, 
boolean isAdjustedToUTC) {
     return ParquetValueReaders.timestamps(desc);
   }
+
+  public void setCustomType(int fieldId, Class<? extends StructLike> type) {
+    this.typesById.put(fieldId, type);
+  }
+
+  public void setRootType(Class<? extends StructLike> rootClass) {
+    setCustomType(ROOT_ID, rootClass);

Review Comment:
   do we need the `ROOT_ID`? why not just 
   ```
   this.rootType = rootClass;
   ```



##########
parquet/src/main/java/org/apache/iceberg/parquet/Parquet.java:
##########
@@ -1245,10 +1252,26 @@ public ReadBuilder 
createBatchedReaderFunc(Function<MessageType, VectorizedReade
       Preconditions.checkArgument(
           this.readerFuncWithSchema == null,
           "Cannot set batched reader function: 2-argument reader function 
already set");
+      Preconditions.checkArgument(
+          this.internalReader == null,
+          "Cannot set batched reader function: internal reader already set");
       this.batchedReaderFunc = func;
       return this;
     }
 
+    public ReadBuilder useInternalReader(InternalReader<?> reader) {
+      Preconditions.checkArgument(
+          this.readerFunc == null, "Cannot set internal reader: reader 
function already set");
+      Preconditions.checkArgument(
+          this.readerFuncWithSchema == null,
+          "Cannot set internal reader: 2-argument reader function already 
set");
+      Preconditions.checkArgument(
+          this.internalReader == null, "Cannot set internal reader: internal 
reader already set");

Review Comment:
   I think you meant `batchedReaderFunc` here



##########
parquet/src/main/java/org/apache/iceberg/data/parquet/InternalReader.java:
##########
@@ -72,4 +91,12 @@ protected ParquetValueReader<?> timeReader(ColumnDescriptor 
desc) {
   protected ParquetValueReader<?> timestampReader(ColumnDescriptor desc, 
boolean isAdjustedToUTC) {
     return ParquetValueReaders.timestamps(desc);
   }
+
+  public void setCustomType(int fieldId, Class<? extends StructLike> type) {

Review Comment:
   have this class implements the `SupportsCustomTypes` interface like Avro 
InternalReader



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

Reply via email to