You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gluten.apache.org by "liuneng1994 (via GitHub)" <gi...@apache.org> on 2024/08/14 09:39:30 UTC

[PR] [CH] A simple job scheduler for merge tree cache sync load [incubator-gluten]

liuneng1994 opened a new pull request, #6842:
URL: https://github.com/apache/incubator-gluten/pull/6842

   ## What changes were proposed in this pull request?
   
   When the cache is loaded synchronously, the time consumed may be greater than the timeout of the spark rpc. A new asynchronous task mechanism is introduced to implement cache synchronous loading through polling, and a unified exception handling is added.
   
   ## How was this patch tested?
   
   unit tests
   
   
   (If this patch involves UI changes, please attach a screenshot; otherwise, remove this)
   
   


-- 
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-unsubscribe@gluten.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CH] A simple job scheduler for merge tree cache sync load [incubator-gluten]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #6842:
URL: https://github.com/apache/incubator-gluten/pull/6842#issuecomment-2290430503

   Run Gluten Clickhouse CI


-- 
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-unsubscribe@gluten.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CH] A simple job scheduler for merge tree cache sync load [incubator-gluten]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #6842:
URL: https://github.com/apache/incubator-gluten/pull/6842#issuecomment-2290484901

   Run Gluten Clickhouse CI


-- 
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-unsubscribe@gluten.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CH] A simple job scheduler for merge tree cache sync load [incubator-gluten]

Posted by "liuneng1994 (via GitHub)" <gi...@apache.org>.
liuneng1994 commented on code in PR #6842:
URL: https://github.com/apache/incubator-gluten/pull/6842#discussion_r1721158569


##########
backends-clickhouse/src/main/scala/org/apache/spark/sql/execution/commands/GlutenCHCacheDataCommand.scala:
##########
@@ -201,87 +203,112 @@ case class GlutenCHCacheDataCommand(
           executorIdsToParts.put(executorId, extensionTableNode.getExtensionTableStr)
         }
       })
-
-    // send rpc call
+    val futureList = ArrayBuffer[(String, Future[CacheJobInfo])]()
     if (executorIdsToParts.contains(GlutenCHCacheDataCommand.ALL_EXECUTORS)) {
       // send all parts to all executors
-      val tableMessage = executorIdsToParts.get(GlutenCHCacheDataCommand.ALL_EXECUTORS).get
-      if (asynExecute) {
-        GlutenDriverEndpoint.executorDataMap.forEach(
-          (executorId, executor) => {
-            executor.executorEndpointRef.send(
-              GlutenMergeTreeCacheLoad(tableMessage, selectedColumns.toSet.asJava))
-          })
-        Seq(Row(true, ""))
-      } else {
-        val futureList = ArrayBuffer[Future[CacheLoadResult]]()
-        val resultList = ArrayBuffer[CacheLoadResult]()
-        GlutenDriverEndpoint.executorDataMap.forEach(
-          (executorId, executor) => {
-            futureList.append(
-              executor.executorEndpointRef.ask[CacheLoadResult](
+      val tableMessage = executorIdsToParts(GlutenCHCacheDataCommand.ALL_EXECUTORS)
+      GlutenDriverEndpoint.executorDataMap.forEach(
+        (executorId, executor) => {
+          futureList.append(
+            (
+              executorId,
+              executor.executorEndpointRef.ask[CacheJobInfo](
                 GlutenMergeTreeCacheLoad(tableMessage, selectedColumns.toSet.asJava)
-              ))
-          })
-        futureList.foreach(
-          f => {
-            resultList.append(ThreadUtils.awaitResult(f, Duration.Inf))
-          })
-        if (resultList.exists(!_.success)) {
-          Seq(Row(false, resultList.filter(!_.success).map(_.reason).mkString(";")))
-        } else {
-          Seq(Row(true, ""))
-        }
-      }
+              )))
+        })
     } else {
-      if (asynExecute) {
-        executorIdsToParts.foreach(
-          value => {
-            val executorData = GlutenDriverEndpoint.executorDataMap.get(toExecutorId(value._1))
-            if (executorData != null) {
-              executorData.executorEndpointRef.send(
-                GlutenMergeTreeCacheLoad(value._2, selectedColumns.toSet.asJava))
-            } else {
-              throw new GlutenException(
-                s"executor ${value._1} not found," +
-                  s" all executors are ${GlutenDriverEndpoint.executorDataMap.toString}")
-            }
-          })
-        Seq(Row(true, ""))
-      } else {
-        val futureList = ArrayBuffer[Future[CacheLoadResult]]()
-        val resultList = ArrayBuffer[CacheLoadResult]()
-        executorIdsToParts.foreach(
-          value => {
-            val executorData = GlutenDriverEndpoint.executorDataMap.get(toExecutorId(value._1))
-            if (executorData != null) {
-              futureList.append(
-                executorData.executorEndpointRef.ask[CacheLoadResult](
-                  GlutenMergeTreeCacheLoad(value._2, selectedColumns.toSet.asJava)
-                ))
-            } else {
-              throw new GlutenException(
-                s"executor ${value._1} not found," +
-                  s" all executors are ${GlutenDriverEndpoint.executorDataMap.toString}")
-            }
-          })
-        futureList.foreach(
-          f => {
-            resultList.append(ThreadUtils.awaitResult(f, Duration.Inf))
-          })
-        if (resultList.exists(!_.success)) {
-          Seq(Row(false, resultList.filter(!_.success).map(_.reason).mkString(";")))
-        } else {
-          Seq(Row(true, ""))
-        }
-      }
+      executorIdsToParts.foreach(
+        value => {
+          checkExecutorId(value._1)
+          val executorData = GlutenDriverEndpoint.executorDataMap.get(toExecutorId(value._1))
+          futureList.append(
+            (
+              value._1,
+              executorData.executorEndpointRef.ask[CacheJobInfo](
+                GlutenMergeTreeCacheLoad(value._2, selectedColumns.toSet.asJava)
+              )))
+        })
+    }
+    val resultList = waitRpcResults(futureList)
+    if (asynExecute) {
+      val res = collectJobTriggerResult(resultList)
+      Seq(Row(res._1, res._2.mkString(";")))
+    } else {
+      val res = waitAllJobFinish(resultList)
+      Seq(Row(res._1, res._2))
     }
   }
+
 }
 
 object GlutenCHCacheDataCommand {
-  val ALL_EXECUTORS = "allExecutors"
+  private val ALL_EXECUTORS = "allExecutors"
 
   private def toExecutorId(executorId: String): String =
     executorId.split("_").last
+
+  def waitAllJobFinish(jobs: ArrayBuffer[(String, CacheJobInfo)]): (Boolean, String) = {
+    val res = collectJobTriggerResult(jobs)
+    var status = res._1
+    val messages = res._2
+    jobs.foreach(
+      job => {
+        if (status) {
+          var complete = false
+          while (!complete) {
+            Thread.sleep(5000)

Review Comment:
   预期异步加载时间是分钟级到小时级,频率不宜过高



-- 
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-unsubscribe@gluten.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CH] A simple job scheduler for merge tree cache sync load [incubator-gluten]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #6842:
URL: https://github.com/apache/incubator-gluten/pull/6842#issuecomment-2288304028

   Run Gluten Clickhouse CI


-- 
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-unsubscribe@gluten.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CH] A simple job scheduler for merge tree cache sync load [incubator-gluten]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #6842:
URL: https://github.com/apache/incubator-gluten/pull/6842#issuecomment-2288303580

   <!--
     Licensed to the Apache Software Foundation (ASF) under one
     or more contributor license agreements.  See the NOTICE file
     distributed with this work for additional information
     regarding copyright ownership.  The ASF licenses this file
     to you under the Apache License, Version 2.0 (the
     "License"); you may not use this file except in compliance
     with the License.  You may obtain a copy of the License at
   
       http://www.apache.org/licenses/LICEGJ-2.0
   
     Unless required by applicable law or agreed to in writing,
     software distributed under the License is distributed on an
     "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
     KIND, either express or implied.  See the License for the
     specific language governing permissions and limitations
     under the License.
   -->
   
   Thanks for opening a pull request!
   
   Could you open an issue for this pull request on Github Issues?
   
   https://github.com/apache/incubator-gluten/issues
   
   Then could you also rename ***commit message*** and ***pull request title*** in the following format?
   
       [GLUTEN-${ISSUES_ID}][COMPONENT]feat/fix: ${detailed message}
   
   See also:
   
     * [Other pull requests](https://github.com/apache/incubator-gluten/pulls/)
   
   


-- 
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-unsubscribe@gluten.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CH] A simple job scheduler for merge tree cache sync load [incubator-gluten]

Posted by "liuneng1994 (via GitHub)" <gi...@apache.org>.
liuneng1994 commented on PR #6842:
URL: https://github.com/apache/incubator-gluten/pull/6842#issuecomment-2295719277

   Run Gluten Clickhouse CI


-- 
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-unsubscribe@gluten.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CH] A simple job scheduler for merge tree cache sync load [incubator-gluten]

Posted by "zzcclp (via GitHub)" <gi...@apache.org>.
zzcclp commented on code in PR #6842:
URL: https://github.com/apache/incubator-gluten/pull/6842#discussion_r1721154953


##########
backends-clickhouse/src/main/scala/org/apache/spark/sql/execution/commands/GlutenCHCacheDataCommand.scala:
##########
@@ -201,87 +203,112 @@ case class GlutenCHCacheDataCommand(
           executorIdsToParts.put(executorId, extensionTableNode.getExtensionTableStr)
         }
       })
-
-    // send rpc call
+    val futureList = ArrayBuffer[(String, Future[CacheJobInfo])]()
     if (executorIdsToParts.contains(GlutenCHCacheDataCommand.ALL_EXECUTORS)) {
       // send all parts to all executors
-      val tableMessage = executorIdsToParts.get(GlutenCHCacheDataCommand.ALL_EXECUTORS).get
-      if (asynExecute) {
-        GlutenDriverEndpoint.executorDataMap.forEach(
-          (executorId, executor) => {
-            executor.executorEndpointRef.send(
-              GlutenMergeTreeCacheLoad(tableMessage, selectedColumns.toSet.asJava))
-          })
-        Seq(Row(true, ""))
-      } else {
-        val futureList = ArrayBuffer[Future[CacheLoadResult]]()
-        val resultList = ArrayBuffer[CacheLoadResult]()
-        GlutenDriverEndpoint.executorDataMap.forEach(
-          (executorId, executor) => {
-            futureList.append(
-              executor.executorEndpointRef.ask[CacheLoadResult](
+      val tableMessage = executorIdsToParts(GlutenCHCacheDataCommand.ALL_EXECUTORS)
+      GlutenDriverEndpoint.executorDataMap.forEach(
+        (executorId, executor) => {
+          futureList.append(
+            (
+              executorId,
+              executor.executorEndpointRef.ask[CacheJobInfo](
                 GlutenMergeTreeCacheLoad(tableMessage, selectedColumns.toSet.asJava)
-              ))
-          })
-        futureList.foreach(
-          f => {
-            resultList.append(ThreadUtils.awaitResult(f, Duration.Inf))
-          })
-        if (resultList.exists(!_.success)) {
-          Seq(Row(false, resultList.filter(!_.success).map(_.reason).mkString(";")))
-        } else {
-          Seq(Row(true, ""))
-        }
-      }
+              )))
+        })
     } else {
-      if (asynExecute) {
-        executorIdsToParts.foreach(
-          value => {
-            val executorData = GlutenDriverEndpoint.executorDataMap.get(toExecutorId(value._1))
-            if (executorData != null) {
-              executorData.executorEndpointRef.send(
-                GlutenMergeTreeCacheLoad(value._2, selectedColumns.toSet.asJava))
-            } else {
-              throw new GlutenException(
-                s"executor ${value._1} not found," +
-                  s" all executors are ${GlutenDriverEndpoint.executorDataMap.toString}")
-            }
-          })
-        Seq(Row(true, ""))
-      } else {
-        val futureList = ArrayBuffer[Future[CacheLoadResult]]()
-        val resultList = ArrayBuffer[CacheLoadResult]()
-        executorIdsToParts.foreach(
-          value => {
-            val executorData = GlutenDriverEndpoint.executorDataMap.get(toExecutorId(value._1))
-            if (executorData != null) {
-              futureList.append(
-                executorData.executorEndpointRef.ask[CacheLoadResult](
-                  GlutenMergeTreeCacheLoad(value._2, selectedColumns.toSet.asJava)
-                ))
-            } else {
-              throw new GlutenException(
-                s"executor ${value._1} not found," +
-                  s" all executors are ${GlutenDriverEndpoint.executorDataMap.toString}")
-            }
-          })
-        futureList.foreach(
-          f => {
-            resultList.append(ThreadUtils.awaitResult(f, Duration.Inf))
-          })
-        if (resultList.exists(!_.success)) {
-          Seq(Row(false, resultList.filter(!_.success).map(_.reason).mkString(";")))
-        } else {
-          Seq(Row(true, ""))
-        }
-      }
+      executorIdsToParts.foreach(
+        value => {
+          checkExecutorId(value._1)
+          val executorData = GlutenDriverEndpoint.executorDataMap.get(toExecutorId(value._1))
+          futureList.append(
+            (
+              value._1,
+              executorData.executorEndpointRef.ask[CacheJobInfo](
+                GlutenMergeTreeCacheLoad(value._2, selectedColumns.toSet.asJava)
+              )))
+        })
+    }
+    val resultList = waitRpcResults(futureList)
+    if (asynExecute) {
+      val res = collectJobTriggerResult(resultList)
+      Seq(Row(res._1, res._2.mkString(";")))
+    } else {
+      val res = waitAllJobFinish(resultList)
+      Seq(Row(res._1, res._2))
     }
   }
+
 }
 
 object GlutenCHCacheDataCommand {
-  val ALL_EXECUTORS = "allExecutors"
+  private val ALL_EXECUTORS = "allExecutors"
 
   private def toExecutorId(executorId: String): String =
     executorId.split("_").last
+
+  def waitAllJobFinish(jobs: ArrayBuffer[(String, CacheJobInfo)]): (Boolean, String) = {
+    val res = collectJobTriggerResult(jobs)
+    var status = res._1
+    val messages = res._2
+    jobs.foreach(
+      job => {
+        if (status) {
+          var complete = false
+          while (!complete) {
+            Thread.sleep(5000)

Review Comment:
   5000 ? consider to reduce this value to 1000 or less



-- 
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-unsubscribe@gluten.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CH] A simple job scheduler for merge tree cache sync load [incubator-gluten]

Posted by "liuneng1994 (via GitHub)" <gi...@apache.org>.
liuneng1994 merged PR #6842:
URL: https://github.com/apache/incubator-gluten/pull/6842


-- 
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-unsubscribe@gluten.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CH] A simple job scheduler for merge tree cache sync load [incubator-gluten]

Posted by "zzcclp (via GitHub)" <gi...@apache.org>.
zzcclp commented on code in PR #6842:
URL: https://github.com/apache/incubator-gluten/pull/6842#discussion_r1721149160


##########
backends-clickhouse/src/main/scala/org/apache/spark/sql/execution/commands/GlutenCHCacheDataCommand.scala:
##########
@@ -100,14 +102,14 @@ case class GlutenCHCacheDataCommand(
       selectedColuman.get
         .filter(allColumns.contains(_))
         .map(ConverterUtils.normalizeColName)
-        .toSeq

Review Comment:
   don't remove this, will failed with the Scala 2.13



-- 
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-unsubscribe@gluten.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CH] A simple job scheduler for merge tree cache sync load [incubator-gluten]

Posted by "liuneng1994 (via GitHub)" <gi...@apache.org>.
liuneng1994 commented on code in PR #6842:
URL: https://github.com/apache/incubator-gluten/pull/6842#discussion_r1721158569


##########
backends-clickhouse/src/main/scala/org/apache/spark/sql/execution/commands/GlutenCHCacheDataCommand.scala:
##########
@@ -201,87 +203,112 @@ case class GlutenCHCacheDataCommand(
           executorIdsToParts.put(executorId, extensionTableNode.getExtensionTableStr)
         }
       })
-
-    // send rpc call
+    val futureList = ArrayBuffer[(String, Future[CacheJobInfo])]()
     if (executorIdsToParts.contains(GlutenCHCacheDataCommand.ALL_EXECUTORS)) {
       // send all parts to all executors
-      val tableMessage = executorIdsToParts.get(GlutenCHCacheDataCommand.ALL_EXECUTORS).get
-      if (asynExecute) {
-        GlutenDriverEndpoint.executorDataMap.forEach(
-          (executorId, executor) => {
-            executor.executorEndpointRef.send(
-              GlutenMergeTreeCacheLoad(tableMessage, selectedColumns.toSet.asJava))
-          })
-        Seq(Row(true, ""))
-      } else {
-        val futureList = ArrayBuffer[Future[CacheLoadResult]]()
-        val resultList = ArrayBuffer[CacheLoadResult]()
-        GlutenDriverEndpoint.executorDataMap.forEach(
-          (executorId, executor) => {
-            futureList.append(
-              executor.executorEndpointRef.ask[CacheLoadResult](
+      val tableMessage = executorIdsToParts(GlutenCHCacheDataCommand.ALL_EXECUTORS)
+      GlutenDriverEndpoint.executorDataMap.forEach(
+        (executorId, executor) => {
+          futureList.append(
+            (
+              executorId,
+              executor.executorEndpointRef.ask[CacheJobInfo](
                 GlutenMergeTreeCacheLoad(tableMessage, selectedColumns.toSet.asJava)
-              ))
-          })
-        futureList.foreach(
-          f => {
-            resultList.append(ThreadUtils.awaitResult(f, Duration.Inf))
-          })
-        if (resultList.exists(!_.success)) {
-          Seq(Row(false, resultList.filter(!_.success).map(_.reason).mkString(";")))
-        } else {
-          Seq(Row(true, ""))
-        }
-      }
+              )))
+        })
     } else {
-      if (asynExecute) {
-        executorIdsToParts.foreach(
-          value => {
-            val executorData = GlutenDriverEndpoint.executorDataMap.get(toExecutorId(value._1))
-            if (executorData != null) {
-              executorData.executorEndpointRef.send(
-                GlutenMergeTreeCacheLoad(value._2, selectedColumns.toSet.asJava))
-            } else {
-              throw new GlutenException(
-                s"executor ${value._1} not found," +
-                  s" all executors are ${GlutenDriverEndpoint.executorDataMap.toString}")
-            }
-          })
-        Seq(Row(true, ""))
-      } else {
-        val futureList = ArrayBuffer[Future[CacheLoadResult]]()
-        val resultList = ArrayBuffer[CacheLoadResult]()
-        executorIdsToParts.foreach(
-          value => {
-            val executorData = GlutenDriverEndpoint.executorDataMap.get(toExecutorId(value._1))
-            if (executorData != null) {
-              futureList.append(
-                executorData.executorEndpointRef.ask[CacheLoadResult](
-                  GlutenMergeTreeCacheLoad(value._2, selectedColumns.toSet.asJava)
-                ))
-            } else {
-              throw new GlutenException(
-                s"executor ${value._1} not found," +
-                  s" all executors are ${GlutenDriverEndpoint.executorDataMap.toString}")
-            }
-          })
-        futureList.foreach(
-          f => {
-            resultList.append(ThreadUtils.awaitResult(f, Duration.Inf))
-          })
-        if (resultList.exists(!_.success)) {
-          Seq(Row(false, resultList.filter(!_.success).map(_.reason).mkString(";")))
-        } else {
-          Seq(Row(true, ""))
-        }
-      }
+      executorIdsToParts.foreach(
+        value => {
+          checkExecutorId(value._1)
+          val executorData = GlutenDriverEndpoint.executorDataMap.get(toExecutorId(value._1))
+          futureList.append(
+            (
+              value._1,
+              executorData.executorEndpointRef.ask[CacheJobInfo](
+                GlutenMergeTreeCacheLoad(value._2, selectedColumns.toSet.asJava)
+              )))
+        })
+    }
+    val resultList = waitRpcResults(futureList)
+    if (asynExecute) {
+      val res = collectJobTriggerResult(resultList)
+      Seq(Row(res._1, res._2.mkString(";")))
+    } else {
+      val res = waitAllJobFinish(resultList)
+      Seq(Row(res._1, res._2))
     }
   }
+
 }
 
 object GlutenCHCacheDataCommand {
-  val ALL_EXECUTORS = "allExecutors"
+  private val ALL_EXECUTORS = "allExecutors"
 
   private def toExecutorId(executorId: String): String =
     executorId.split("_").last
+
+  def waitAllJobFinish(jobs: ArrayBuffer[(String, CacheJobInfo)]): (Boolean, String) = {
+    val res = collectJobTriggerResult(jobs)
+    var status = res._1
+    val messages = res._2
+    jobs.foreach(
+      job => {
+        if (status) {
+          var complete = false
+          while (!complete) {
+            Thread.sleep(5000)

Review Comment:
   缓存异步加载时间是分钟级到小时级,频率不宜过高



-- 
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-unsubscribe@gluten.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org