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


##########
hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/command/procedures/RunCompactionProcedure.scala:
##########
@@ -59,76 +61,63 @@ class RunCompactionProcedure extends BaseProcedure with 
ProcedureBuilder with Sp
   override def call(args: ProcedureArgs): Seq[Row] = {
     super.checkArgs(PARAMETERS, args)
 
-    val operation = getArgValueOrDefault(args, 
PARAMETERS(0)).get.asInstanceOf[String].toLowerCase
+    var op = getArgValueOrDefault(args, 
PARAMETERS(0)).get.asInstanceOf[String].toLowerCase
     val tableName = getArgValueOrDefault(args, PARAMETERS(1))
     val tablePath = getArgValueOrDefault(args, PARAMETERS(2))
     val instantTimestamp = getArgValueOrDefault(args, PARAMETERS(3))
     var confs: Map[String, String] = Map.empty
     if (getArgValueOrDefault(args, PARAMETERS(4)).isDefined) {
       confs = confs ++ 
HoodieCLIUtils.extractOptions(getArgValueOrDefault(args, 
PARAMETERS(4)).get.asInstanceOf[String])
     }
+    var specificInstants = getArgValueOrDefault(args, PARAMETERS(5))
+
+    // For old version compatibility
+    if (op.equals("run")) {
+      op = "scheduleandexecute"
+    }
+    if (instantTimestamp.isDefined && specificInstants.isEmpty) {

Review Comment:
   This removes previous functionality.
   
   Example:
   
   ```sql
   call run_compaction(table => '$tableName', op => 'schedule', 
timestamp=20230712HHMMss000)
   ```
   
   This will overwrite the op from `schedule` to `execute`. Users will no 
longer to perform a schedule with a pre-defined instant. (This is exceptionally 
useful if they are running a schedule operation in a cluster that is running in 
a different timezone, setting a timestamp/instant manually allows us to 
override timezones which aids testing.)



-- 
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: commits-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to