ajantha-bhat commented on code in PR #4902:
URL: https://github.com/apache/iceberg/pull/4902#discussion_r913722777


##########
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:
   Underlaying sparkAction uses a separate strategy for Zorder instead of 
handling in the sort strategy. 
   So, it is not possible to set more than one strategy now. 
   
   cc: @RussellSpitzer 



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