From 7aa344540590deb50bd2df9cbcc257b87fa7db53 Mon Sep 17 00:00:00 2001 From: fwang12 Date: Fri, 9 Dec 2022 22:23:49 +0800 Subject: [PATCH] [KYUUBI #3949] Print the simple batch report if no log fetch to prevent misunderstand ### _Why are the changes needed?_ With yarn-cluster mode, if `spark.yarn.submit.waitAppCompletion` is false and `kyuubi-ctl` wait completion is true, we need still print some simple batch report to prevent misunderstand. The batch report format refer spark-submit log. ``` Application report for (state: RUNNING) ``` ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [ ] Add screenshots for manual tests if appropriate - [x] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request Closes #3949 from turboFei/ctl_log. Closes #3949 8fbba0f8 [fwang12] keep same format with app state ea5597fa [fwang12] print appId d6d839c1 [fwang12] Print the simple batch report if no log fetch bb908b1b [fwang12] log batch state if there is no log Authored-by: fwang12 Signed-off-by: fwang12 --- .../org/apache/kyuubi/ctl/cmd/log/LogBatchCommand.scala | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/cmd/log/LogBatchCommand.scala b/kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/cmd/log/LogBatchCommand.scala index 0ac209329..cc051629d 100644 --- a/kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/cmd/log/LogBatchCommand.scala +++ b/kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/cmd/log/LogBatchCommand.scala @@ -81,6 +81,12 @@ class LogBatchCommand( } if (!done) { + if (!Option(log).exists(_.getRowCount > 0)) { + Option(batch).foreach { batch => + info(s"Application report for ${batch.getAppId} (state: ${batch.getAppState})," + + s" batch id: $batchId (state: ${batch.getState})") + } + } Thread.sleep(conf.get(CTL_BATCH_LOG_QUERY_INTERVAL)) } }