dramaticlly commented on code in PR #11045:
URL: https://github.com/apache/iceberg/pull/11045#discussion_r1739199528


##########
spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/procedures/CreateChangelogViewProcedure.java:
##########
@@ -183,21 +185,26 @@ private boolean shouldComputeUpdateImages(ProcedureInput 
input) {
   }
 
   private Dataset<Row> removeCarryoverRows(Dataset<Row> df, boolean 
netChanges) {
-    Predicate<String> columnsToKeep;
-    if (netChanges) {
-      Set<String> metadataColumn =
-          Sets.newHashSet(
-              MetadataColumns.CHANGE_TYPE.name(),
-              MetadataColumns.CHANGE_ORDINAL.name(),
-              MetadataColumns.COMMIT_SNAPSHOT_ID.name());
-
-      columnsToKeep = column -> !metadataColumn.contains(column);
-    } else {
-      columnsToKeep = column -> 
!column.equals(MetadataColumns.CHANGE_TYPE.name());
-    }
+    Set<String> metadataColumn =
+        netChanges
+            ? Sets.newHashSet(
+                MetadataColumns.CHANGE_TYPE.name(),
+                MetadataColumns.CHANGE_ORDINAL.name(),
+                MetadataColumns.COMMIT_SNAPSHOT_ID.name())
+            : Sets.newHashSet(MetadataColumns.CHANGE_TYPE.name());
+
+    Predicate<StructField> columnsToDiscard =
+        field ->
+            metadataColumn.contains(field.name())
+                // avoid sort on incomparable columns
+                || field.dataType() instanceof MapType

Review Comment:
   yeah that's a good point, let me use 
`OrderUtils.isOrderable(field.dataType())` instead



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