You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "flyrain (via GitHub)" <gi...@apache.org> on 2023/02/22 19:06:51 UTC

[GitHub] [iceberg] flyrain commented on a diff in pull request #6898: Spark 3.3: Handle Spark Row more generically

flyrain commented on code in PR #6898:
URL: https://github.com/apache/iceberg/pull/6898#discussion_r1114837323


##########
spark/v3.3/spark/src/main/java/org/apache/iceberg/spark/ChangelogIterator.java:
##########
@@ -147,19 +163,6 @@ private int[] generateIndicesForIdentifySameRow(Row row) {
     return indices;
   }
 
-  private Row[] createUpdateChangelog(
-      GenericRowWithSchema currentRow, GenericRowWithSchema nextRow) {
-    GenericInternalRow deletedRow = new GenericInternalRow(currentRow.values());
-    GenericInternalRow insertedRow = new GenericInternalRow(nextRow.values());
-
-    deletedRow.update(changeTypeIndex, UPDATE_BEFORE);
-    insertedRow.update(changeTypeIndex, UPDATE_AFTER);
-
-    return new Row[] {
-      RowFactory.create(deletedRow.values()), RowFactory.create(insertedRow.values())
-    };
-  }
-
   private boolean isCarryoverRecord(Row currentRow, Row nextRow) {
     for (int idx : indicesForIdentifySameRow) {
       if (!isColumnSame(currentRow, nextRow, idx)) {

Review Comment:
   To precompute would be faster than to check within the loop.  More details are in https://github.com/apache/iceberg/pull/6344/files/e813670402459901ed4f2b36cb24349145b705ac#r1060949312. 



-- 
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-unsubscribe@iceberg.apache.org

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