rdblue commented on a change in pull request #1790:
URL: https://github.com/apache/iceberg/pull/1790#discussion_r533752902



##########
File path: flink/src/main/java/org/apache/iceberg/flink/data/FlinkOrcWriter.java
##########
@@ -46,8 +50,8 @@ private FlinkOrcWriter(RowType rowType, Schema iSchema) {
     }
   }
 
-  public static OrcRowWriter<RowData> buildWriter(RowType rowType, Schema 
iSchema) {
-    return new FlinkOrcWriter(rowType, iSchema);
+  public static OrcRowWriter<RowData> buildWriter(RowType rowType, Schema 
iSchema, TypeDescription schema) {

Review comment:
       The field IDs are kept in struct fields, not primitives. That's probably 
why you didn't find one that was usable in the `primitive` method. What we do 
in other visitors is add methods to the visitor that are called before and 
after visiting a struct field, array element, map key, and map value. Those 
methods are passed the field. Then the visitor just needs to implement the 
before/after to maintain a stack of field IDs.
   
   Here's a `visit` method with the callbacks: 
https://github.com/apache/iceberg/blob/master/api/src/main/java/org/apache/iceberg/types/TypeUtil.java#L334
   And here's an example of using them to get the field IDs: 
https://github.com/apache/iceberg/blob/master/core/src/main/java/org/apache/iceberg/avro/TypeToSchema.java#L75-L83




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

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