openinx commented on a change in pull request #3248:
URL: https://github.com/apache/iceberg/pull/3248#discussion_r726912272



##########
File path: data/src/main/java/org/apache/iceberg/data/orc/GenericOrcWriter.java
##########
@@ -150,18 +135,8 @@ public void write(Record value, VectorizedRowBatch output) 
{
     }
 
     @Override
-    @SuppressWarnings("unchecked")
-    public void nonNullWrite(int rowId, Record data, ColumnVector output) {
-      StructColumnVector cv = (StructColumnVector) output;
-      for (int c = 0; c < writers.size(); ++c) {
-        OrcValueWriter child = writers.get(c);
-        child.write(rowId, data.get(c, child.getJavaClass()), cv.fields[c]);
-      }
-    }
-
-    @Override
-    public Stream<FieldMetrics<?>> metrics() {
-      return writers.stream().flatMap(OrcValueWriter::metrics);
+    protected Object get(Record struct, int index) {
+      return struct.get(index, writers().get(index).getJavaClass());

Review comment:
       I think the `Class<?> getJavaClass()` from `OrcValueWriter` can be 
removed now ha ?  Because it's the only place that we will use the 
`getJavaClass` , while the `struct` is actually a `Record` which means we could 
just use the `struct#get(index)` here, right ?




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