yusufyildiz34 commented on code in PR #18508:
URL: https://github.com/apache/iceberg/pull/18508#discussion_r4287853207


##########
flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/RowDataWrapper.java:
##########
@@ -155,8 +166,114 @@ private static PositionalGetter<?> 
buildGetter(LogicalType logicalType, Type typ
         RowDataWrapper nestedWrapper = new RowDataWrapper(rowType, structType);
         return (row, pos) -> nestedWrapper.wrap(row.getRow(pos, 
rowType.getFieldCount()));
 
+      case ARRAY:
+        Function<Object, Object> listConverter = buildConverter(logicalType, 
type);
+        return (row, pos) -> listConverter.apply(row.getArray(pos));
+
+      case MAP:
+        Function<Object, Object> mapConverter = buildConverter(logicalType, 
type);
+        return (row, pos) -> mapConverter.apply(row.getMap(pos));
+
       default:
         return null;
     }
   }
+
+  private static Function<Object, Object> buildConverter(LogicalType 
logicalType, Type type) {

Review Comment:
   Done. `buildGetter` now reads the raw value with 
`FlinkRowData.createFieldGetter` and converts it with `buildConverter`, so 
there is only one switch.
   
   I didn't keep ROW separate, though, because it conflicts with sharing 
getters across element wrappers (your ROW comment). The reused nested wrapper 
ends up inside a shared getter, so nested structs in different list elements 
overwrite each other. `nestedStructsInListElementsAreIndependent` fails with 
that version. Now each struct read gets its own small wrapper, which costs one 
allocation per struct read on top of the boxing you mentioned. If you'd rather 
keep the reuse for top-level structs, I can add a separate path for the element 
templates. 
   
   Since no getter uses the position anymore, I also replaced 
`PositionalGetter` with `RowData.FieldGetter`.



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