You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/03/05 03:10:20 UTC

[GitHub] [iceberg] openinx commented on a change in pull request #2047: Flink: Refactor flink source tests for FLIP-27 unified source.

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



##########
File path: flink/src/main/java/org/apache/iceberg/flink/data/RowDataUtil.java
##########
@@ -69,4 +74,30 @@ public static Object convertConstant(Type type, Object value) {
     }
     return value;
   }
+
+  /**
+   * Similar to the private {@link RowDataSerializer#copyRowData(RowData, RowData)} method.
+   * This skips the check the arity of rowType and from,
+   * because the from RowData may contains additional column for position deletes.
+   * Using {@link RowDataSerializer#copy(RowData, RowData)} will fail the arity check.
+   */
+  public static RowData clone(RowData from, RowData reuse, RowType rowType, TypeSerializer[] fieldSerializers) {

Review comment:
       OK ,  seems we're clone the rowData iterately,  I saw the  `FieldGetter` will be created for each row  [here](https://github.com/apache/iceberg/pull/2047/files#diff-81028bf7f8758383a5976b7c1461931a41485de740642252f5fd0c5c9cec51dfR94),  that should also not be the expected behavior.  We may need to introduce an new `RowDataCloner` which will initialize all its TypeSerializer &  `FieldGetter` once in instance constructor,  when iterating the `RowData` we will just clone row by row don't need to create any extra instances.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org