RussellSpitzer commented on code in PR #4902:
URL: https://github.com/apache/iceberg/pull/4902#discussion_r916338663


##########
spark/v3.2/spark-extensions/src/test/java/org/apache/iceberg/spark/extensions/TestRewriteDataFilesProcedure.java:
##########
@@ -292,6 +341,19 @@ public void testRewriteDataFilesWithInvalidInputs() {
         IllegalArgumentException.class, "Cannot parse predicates in where 
option: col1 = 3",
         () -> sql("CALL %s.system.rewrite_data_files(table => '%s', " +
             "where => 'col1 = 3')", catalogName, tableIdent));
+
+    // Test for z_order with invalid column name
+    AssertHelpers.assertThrows("Should reject calls with error message",
+        IllegalArgumentException.class, "Cannot find field 'col1' in struct:" +
+            " struct<1: c1: optional int, 2: c2: optional string, 3: c3: 
optional string>",
+        () -> sql("CALL %s.system.rewrite_data_files(table => '%s', strategy 
=> 'sort', " +
+            "sort_order => 'zorder(col1)')", catalogName, tableIdent));
+
+    // Test for z_order with sort_order
+    AssertHelpers.assertThrows("Should reject calls with error message",
+        IllegalArgumentException.class, "Both SortOrder and Zorder is 
configured: c1,zorder(c2,c3)",

Review Comment:
   Yep that was my only comment on this before, We technically could accomplish 
this with some code changes to do this, but the code doesn't not currently 
allow it.



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

Reply via email to