huaxingao commented on code in PR #12494:
URL: https://github.com/apache/iceberg/pull/12494#discussion_r2040874901


##########
spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/procedures/CreateChangelogViewProcedure.java:
##########
@@ -246,11 +249,10 @@ private String viewName(ProcedureInput input, String 
tableName) {
     return input.asString(CHANGELOG_VIEW_PARAM, defaultValue);
   }
 
-  private Dataset<Row> applyChangelogIterator(Dataset<Row> df, Column[] 
repartitionSpec) {
+  private Dataset<Row> applyChangelogIterator(
+      Dataset<Row> df, Column[] repartitionSpec, String[] identifierFields) {
     Column[] sortSpec = sortSpec(df, repartitionSpec, false);
     StructType schema = df.schema();
-    String[] identifierFields =
-        
Arrays.stream(repartitionSpec).map(Column::toString).toArray(String[]::new);

Review Comment:
   `Column::toString` now returns a fully qualified column, and it causes 
`fieldIndex(name: String)` to fail later. 
   
   We actually have a String array of `identifierFields` in 
`computeUpdateImages` (only need to append 
`MetadataColumns.CHANGE_ORDINAL.name()` in the end). So Instead of calling 
   ```
   override def toString: String = node.sql
   ```
   I think it's more efficient to pass in the String array of `identifierFields`
   



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

Reply via email to