diff --git a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/BatchesResource.scala b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/BatchesResource.scala index 12db68aeba7..a525ac4b2e0 100644 --- a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/BatchesResource.scala +++ b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/BatchesResource.scala @@ -415,6 +415,13 @@ private[v1] class BatchesResource extends ApiRequestContext with Logging { } else if (fe.connectionUrl != metadata.kyuubiInstance) { val internalRestClient = getInternalRestClient(metadata.kyuubiInstance) internalRestClient.getBatchLocalLog(userName, batchId, from, size) + } else if (batchV2Enabled(metadata.requestConf) && + // in batch v2 impl, the operation state is changed from PENDING to RUNNING + // before being added to SessionManager. + (metadata.state == "PENDING" || metadata.state == "RUNNING")) { + info(s"Batch $batchId is waiting for submitting") + val dummyLogs = List(s"Batch $batchId is waiting for submitting").asJava + new OperationLog(dummyLogs, dummyLogs.size) } else { throw new NotFoundException(s"No local log found for batch: $batchId") }