From e02be17b4eb1def27fc66036e9f49ad80c6f4221 Mon Sep 17 00:00:00 2001 From: dupeng Date: Thu, 11 Apr 2024 13:42:03 +0800 Subject: [PATCH 1/3] [KYUUBI #6288] [KYUUBI #6283] Improve the message of distribution built without enabling web ui MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # :mag: Description Improve message of distribution built without enabling web ui. ## Issue References ๐Ÿ”— This pull request fixes #6283 ## Describe Your Solution ๐Ÿ”ง Here is my implement: image ## Types of changes :bookmark: - [x] Bugfix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) ## Test Plan ๐Ÿงช #### Behavior Without This Pull Request :coffin: #### Behavior With This Pull Request :tada: #### Related Unit Tests --- # Checklist ๐Ÿ“ - [ ] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html) **Be nice. Be informative.** Closes #6288 from dupen01/issue-6283. Closes #6288 a5886e271 [dupeng] revise the message of page bad14a748 [dupeng] improve the message of distribution built without enabling web ui Authored-by: dupeng Signed-off-by: Cheng Pan --- kyuubi-server/src/main/resources/dist/index.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kyuubi-server/src/main/resources/dist/index.html b/kyuubi-server/src/main/resources/dist/index.html index ab54fc14a6a..9d2659f76cc 100644 --- a/kyuubi-server/src/main/resources/dist/index.html +++ b/kyuubi-server/src/main/resources/dist/index.html @@ -23,6 +23,10 @@ Apache Kyuubi Dashboard -
This is a dummy page for development.
+

๐Ÿ™ The Web UI is currently unavailable.

+

๐Ÿ‘‰ To enable Web UI, `--web-ui` is required when using `build/dist` tool to create binary distributions, e.g.

+

+./build/dist --tgz --web-ui --spark-provided --flink-provided --hive-provided
+
From 40ad5e0faeb8d996417cd73c3e83edc853f724ce Mon Sep 17 00:00:00 2001 From: hezhao2 Date: Thu, 11 Apr 2024 16:38:35 +0800 Subject: [PATCH 2/3] Avoid NPE in MySQLErrPacket --- .../org/apache/kyuubi/server/mysql/MySQLGenericPackets.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/mysql/MySQLGenericPackets.scala b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/mysql/MySQLGenericPackets.scala index f378bc0a09a..dcb603358cf 100644 --- a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/mysql/MySQLGenericPackets.scala +++ b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/mysql/MySQLGenericPackets.scala @@ -54,7 +54,8 @@ object MySQLErrPacket { case kse: KyuubiSQLException if kse.getCause != null => // prefer brief nested error message instead of whole stacktrace apply(kse.getCause) - case e: Exception if e.getMessage contains "NoSuchDatabaseException" => + case e: Exception + if (e.getMessage != null) && (e.getMessage contains "NoSuchDatabaseException") => MySQLErrPacket(1, MySQLErrorCode.ER_BAD_DB_ERROR, cause.getMessage) case se: SQLException if se.getSQLState == null => MySQLErrPacket(1, MySQLErrorCode.ER_INTERNAL_ERROR, cause.getMessage) From a58eed609a544558d3bfe51cb270abdb6326a39b Mon Sep 17 00:00:00 2001 From: hezhao2 Date: Thu, 11 Apr 2024 17:33:02 +0800 Subject: [PATCH 3/3] refactor --- .../org/apache/kyuubi/server/mysql/MySQLGenericPackets.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/mysql/MySQLGenericPackets.scala b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/mysql/MySQLGenericPackets.scala index dcb603358cf..946e9c313f8 100644 --- a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/mysql/MySQLGenericPackets.scala +++ b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/mysql/MySQLGenericPackets.scala @@ -55,7 +55,7 @@ object MySQLErrPacket { // prefer brief nested error message instead of whole stacktrace apply(kse.getCause) case e: Exception - if (e.getMessage != null) && (e.getMessage contains "NoSuchDatabaseException") => + if e.getMessage != null && e.getMessage.contains("NoSuchDatabaseException") => MySQLErrPacket(1, MySQLErrorCode.ER_BAD_DB_ERROR, cause.getMessage) case se: SQLException if se.getSQLState == null => MySQLErrPacket(1, MySQLErrorCode.ER_INTERNAL_ERROR, cause.getMessage)