From 70eadc15add3fe102c3a67a199d1796751eed0ca Mon Sep 17 00:00:00 2001 From: Cheng Pan Date: Mon, 20 May 2024 17:20:38 +0800 Subject: [PATCH] [KYUUBI #6390] Temporarily disable UI Tab for Spark 4.0 and above MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # :mag: Description Spark 4.0 migrated from `javax.servlet` to `jakarta.servlet` in SPARK-47118, which breaks the Kyuubi UI tab. ## Describe Your Solution ๐Ÿ”ง Temporarily disable UI Tab for Spark 4.0 and above. ## Types of changes :bookmark: - [ ] 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 ๐Ÿงช Build Kyuubi with Spark 3.5 and successfully launch the Spark engine with Spark 4.0.0 preview1. image --- # Checklist ๐Ÿ“ - [x] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html) **Be nice. Be informative.** Closes #6390 from pan3793/ui-4.0. Closes #6390 2abad8c35 [Cheng Pan] Temporarily disable UI Tab for Spark 4.0 and above Authored-by: Cheng Pan Signed-off-by: Cheng Pan --- .../kyuubi/engine/spark/SparkSQLEngine.scala | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala b/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala index c9a5f21dd..7ada55d39 100644 --- a/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala +++ b/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala @@ -27,7 +27,7 @@ import scala.util.control.NonFatal import com.google.common.annotations.VisibleForTesting import org.apache.hadoop.fs.Path -import org.apache.spark.{ui, SparkConf} +import org.apache.spark.{ui, SPARK_VERSION, SparkConf} import org.apache.spark.kyuubi.{SparkContextHelper, SparkSQLEngineEventListener, SparkSQLEngineListener} import org.apache.spark.kyuubi.SparkUtilsHelper.getLocalDir import org.apache.spark.sql.SparkSession @@ -46,7 +46,7 @@ import org.apache.kyuubi.ha.HighAvailabilityConf._ import org.apache.kyuubi.ha.client.RetryPolicies import org.apache.kyuubi.service.Serverable import org.apache.kyuubi.session.SessionHandle -import org.apache.kyuubi.util.{SignalRegister, ThreadUtils} +import org.apache.kyuubi.util.{SemanticVersion, SignalRegister, ThreadUtils} import org.apache.kyuubi.util.ThreadUtils.scheduleTolerableRunnableWithFixedDelay case class SparkSQLEngine(spark: SparkSession) extends Serverable("SparkSQLEngine") { @@ -358,11 +358,15 @@ object SparkSQLEngine extends Logging { engine.start() val kvStore = SparkContextHelper.getKvStore(spark.sparkContext) val store = new EngineEventsStore(kvStore) - ui.EngineTab( - Some(engine), - SparkContextHelper.getSparkUI(spark.sparkContext), - store, - kyuubiConf) + if (SemanticVersion(SPARK_VERSION) >= "4.0") { + warn("Kyuubi UI does not support Spark 4.0 and above yet") + } else { + ui.EngineTab( + Some(engine), + SparkContextHelper.getSparkUI(spark.sparkContext), + store, + kyuubiConf) + } val event = EngineEvent(engine) info(event) EventBus.post(event)