voonhous commented on code in PR #19687:
URL: https://github.com/apache/hudi/pull/19687#discussion_r3844172543


##########
hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/command/procedures/RunClusteringProcedure.scala:
##########
@@ -233,13 +233,16 @@ class RunClusteringProcedure extends BaseProcedure
     }
 
     val tableSchemaResolver = new TableSchemaResolver(metaClient)
-    val fields = tableSchemaResolver.getTableSchema(false)
-      .getFields.asScala.map(_.name().toLowerCase)
+    val tableSchema = tableSchemaResolver.getTableSchema(false)
+    val fields = tableSchema.getFields.asScala.map(_.name().toLowerCase)
     orderColumns.split(",").foreach(col => {
-      if (!fields.contains(col.toLowerCase)) {
+      if (!fields.contains(col.trim.toLowerCase)) {
         throw new HoodieClusteringException("Order column not exist:" + col)
       }
     })
+    // The same validation the partitioners apply at execution time (see

Review Comment:
   Split once into a `val columns`, shared by the existence check and 
`validateSortableColumns`.



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

Reply via email to