1raghavmahajan commented on code in PR #14291:
URL: https://github.com/apache/iceberg/pull/14291#discussion_r2429593355
##########
spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/procedures/CreateChangelogViewProcedure.java:
##########
@@ -184,16 +185,9 @@ private Dataset<Row> computeUpdateImages(String[]
identifierColumns, Dataset<Row
identifierColumns.length > 0,
"Cannot compute the update images because identifier columns are not
set");
- Column[] repartitionSpec = new Column[identifierColumns.length + 1];
- for (int i = 0; i < identifierColumns.length; i++) {
- repartitionSpec[i] =
df.col(CreateChangelogViewProcedure.delimitedName(identifierColumns[i]));
- }
-
- repartitionSpec[repartitionSpec.length - 1] =
df.col(MetadataColumns.CHANGE_ORDINAL.name());
-
- String[] identifierFields = Arrays.copyOf(identifierColumns,
identifierColumns.length + 1);
- identifierFields[identifierFields.length - 1] =
MetadataColumns.CHANGE_ORDINAL.name();
-
+ String[] identifierFields =
+ ArrayUtil.add(identifierColumns,
MetadataColumns.CHANGE_ORDINAL.name());
+ Column[] repartitionSpec = getColumnReferences(df, identifierFields);
Review Comment:
Had kept it separate as I preferred it for a [follow-up
PR](https://github.com/apache/iceberg/pull/14293). Though I don't mind it being
done with those changes. 👍🏼
Pushed
https://github.com/apache/iceberg/pull/14291/commits/f46a28ddc189f2683493dc0a0fe4a4c5ee79e770
--
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]