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


##########
hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/command/procedures/RunClusteringProcedure.scala:
##########
@@ -120,14 +120,17 @@ class RunClusteringProcedure extends BaseProcedure
       logInfo(s"Partition selected: $selectedPartitions")
     }
 
-    // Construct sort column info
+    // Construct sort column info. Normalise once so the plan stores the same 
trimmed list the
+    // strategies and partitioners work from: the procedure validates the 
argument up front, and
+    // the stored value is what later services see.
     orderColumns match {
       case Some(o) =>
-        validateOrderColumns(o.asInstanceOf[String], metaClient)
+        val normalized = 
o.asInstanceOf[String].split(",").map(_.trim).mkString(",")
+        validateOrderColumns(normalized, metaClient)
         confs = confs ++ Map(
-          HoodieClusteringConfig.PLAN_STRATEGY_SORT_COLUMNS.key() -> 
o.asInstanceOf[String]
+          HoodieClusteringConfig.PLAN_STRATEGY_SORT_COLUMNS.key() -> normalized

Review Comment:
   Done ee5c84f17d69. The order-column block only records the argument now; 
after all three merges the stored `PLAN_STRATEGY_SORT_COLUMNS` is normalised 
and validated once, so `options => 
'hoodie.clustering.plan.strategy.sort.columns=...'` goes through 
`validateOrderColumns` + `SortUtils.validateSortableColumns` too and the plan 
stores the trimmed list. Precedence unchanged (`options` still wins). The 
`TestClusteringProcedure` options leg now pins that no pending plan is left 
behind (the execution-time rejection did leave one) and that the options route 
stores `content,embedding` trimmed.



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