pvary commented on code in PR #10565: URL: https://github.com/apache/iceberg/pull/10565#discussion_r1665112819
########## flink/v1.17/flink/src/main/java/org/apache/iceberg/flink/data/RowDataUtil.java: ########## @@ -78,6 +78,37 @@ public static Object convertConstant(Type type, Object value) { * 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, + RowData.FieldGetter[] fieldGetters) { + GenericRowData ret; + if (reuse instanceof GenericRowData) { + ret = (GenericRowData) reuse; + } else { + ret = new GenericRowData(from.getArity()); + } + + ret.setRowKind(from.getRowKind()); + for (int i = 0; i < rowType.getFieldCount(); i++) { + if (!from.isNullAt(i)) { + ret.setField(i, fieldSerializers[i].copy(fieldGetters[i].getFieldOrNull(from))); + } else { + ret.setField(i, null); + } + } + + return ret; + } + + /** + * @deprecated will be removed in 2.0.0; Not reusing FieldGetter in this method could lead to Review Comment: I think we can remove this in 1.7.0 (if the PR gets merged before the 1.6.0 release) -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org