You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/01/30 08:36:51 UTC
[GitHub] [incubator-kyuubi] SteNicholas commented on a change in pull request #1859: [KYUUBI #1838] Clean up query results after query operations finish
SteNicholas commented on a change in pull request #1859:
URL: https://github.com/apache/incubator-kyuubi/pull/1859#discussion_r795147134
##########
File path: externals/kyuubi-flink-sql-engine/src/main/scala/org/apache/kyuubi/engine/flink/operation/ExecuteStatement.scala
##########
@@ -115,33 +115,42 @@ class ExecuteStatement(
}
private def runQueryOperation(operation: QueryOperation): Unit = {
- val resultDescriptor = executor.executeQuery(sessionId, operation)
-
- val resultID = resultDescriptor.getResultId
-
- val rows = new ArrayBuffer[Row]()
- var loop = true
- while (loop) {
- Thread.sleep(50) // slow the processing down
-
- val result = executor.snapshotResult(sessionId, resultID, 2)
- result.getType match {
- case TypedResult.ResultType.PAYLOAD =>
- rows.clear()
- (1 to result.getPayload).foreach { page =>
- rows ++= executor.retrieveResultPage(resultID, page).asScala
- }
- case TypedResult.ResultType.EOS => loop = false
- case TypedResult.ResultType.EMPTY =>
+ var resultId: String = null
+ try {
+ val resultDescriptor = executor.executeQuery(sessionId, operation)
+
+ resultId = resultDescriptor.getResultId
+
+ val rows = new ArrayBuffer[Row]()
+ var loop = true
+
+ while (loop) {
+ Thread.sleep(50) // slow the processing down
Review comment:
Could the sleep time be configurable?
--
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@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org