From d44947894adf9e9d5a67fd7a7dfde1c9a51c925a Mon Sep 17 00:00:00 2001 From: "Wang, Fei" Date: Sat, 7 Sep 2024 22:38:28 -0700 Subject: [PATCH 1/3] pretty --- .../org/apache/kyuubi/ctl/cmd/delete/DeleteBatchCommand.scala | 2 +- .../org/apache/kyuubi/ctl/cmd/submit/SubmitBatchCommand.scala | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/cmd/delete/DeleteBatchCommand.scala b/kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/cmd/delete/DeleteBatchCommand.scala index ee4a14d2666..288c33ac9ba 100644 --- a/kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/cmd/delete/DeleteBatchCommand.scala +++ b/kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/cmd/delete/DeleteBatchCommand.scala @@ -38,7 +38,7 @@ class DeleteBatchCommand(cliConfig: CliConfig) extends Command[Batch](cliConfig) val result = batchRestApi.deleteBatch(batchId) - info(JsonUtils.toJson(result)) + info(JsonUtils.toPrettyJson(result)) if (!result.isSuccess) { val batch = batchRestApi.getBatchById(batchId) diff --git a/kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/cmd/submit/SubmitBatchCommand.scala b/kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/cmd/submit/SubmitBatchCommand.scala index 863da98d44f..45db7c202c2 100644 --- a/kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/cmd/submit/SubmitBatchCommand.scala +++ b/kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/cmd/submit/SubmitBatchCommand.scala @@ -48,7 +48,8 @@ class SubmitBatchCommand(cliConfig: CliConfig) extends Command[Batch](cliConfig) batch = logBatchCommand.doRun() if (BatchUtils.isTerminalState(batch.getState) && !BatchUtils.isFinishedState(batch.getState)) { - error(s"Batch ${batch.getId} failed: ${JsonUtils.toJson(batch)}") + error(s"Batch ${batch.getId} failed:") + error(Render.renderBatchInfo(batch)) throw ControlCliException(1) } From 0562d2d237c2ab91892f8e751eba2975c0365366 Mon Sep 17 00:00:00 2001 From: "Wang, Fei" Date: Wed, 11 Sep 2024 21:23:13 -0700 Subject: [PATCH 2/3] unused --- .../org/apache/kyuubi/ctl/cmd/submit/SubmitBatchCommand.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/cmd/submit/SubmitBatchCommand.scala b/kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/cmd/submit/SubmitBatchCommand.scala index 45db7c202c2..926cf632efe 100644 --- a/kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/cmd/submit/SubmitBatchCommand.scala +++ b/kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/cmd/submit/SubmitBatchCommand.scala @@ -17,7 +17,7 @@ package org.apache.kyuubi.ctl.cmd.submit import org.apache.kyuubi.client.api.v1.dto.Batch -import org.apache.kyuubi.client.util.{BatchUtils, JsonUtils} +import org.apache.kyuubi.client.util.BatchUtils import org.apache.kyuubi.ctl.ControlCliException import org.apache.kyuubi.ctl.cmd.Command import org.apache.kyuubi.ctl.cmd.create.CreateBatchCommand From f9de99b92dd299842be89dd7252365b69c947e29 Mon Sep 17 00:00:00 2001 From: "Wang, Fei" Date: Sat, 14 Sep 2024 12:32:37 -0700 Subject: [PATCH 3/3] ut --- .../org/apache/kyuubi/server/rest/client/BatchCliSuite.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kyuubi-server/src/test/scala/org/apache/kyuubi/server/rest/client/BatchCliSuite.scala b/kyuubi-server/src/test/scala/org/apache/kyuubi/server/rest/client/BatchCliSuite.scala index ffaac540018..7167ce230f9 100644 --- a/kyuubi-server/src/test/scala/org/apache/kyuubi/server/rest/client/BatchCliSuite.scala +++ b/kyuubi-server/src/test/scala/org/apache/kyuubi/server/rest/client/BatchCliSuite.scala @@ -171,7 +171,7 @@ class BatchCliSuite extends RestClientTestHelper with TestPrematureExit with Bat ldapUser, "--password", ldapUserPasswd) - result = testPrematureExitForControlCli(deleteArgs, "\"success\":true") + result = testPrematureExitForControlCli(deleteArgs, "\"success\" : true") eventually(timeout(3.seconds), interval(200.milliseconds)) { assert(MetricsSystem.counterValue( @@ -230,7 +230,7 @@ class BatchCliSuite extends RestClientTestHelper with TestPrematureExit with Bat batchId, "--authSchema", "spnego") - result = testPrematureExitForControlCli(deleteArgs, "\"success\":true") + result = testPrematureExitForControlCli(deleteArgs, "\"success\" : true") } test("log batch test") {