From eda34d480e226bf768aa4c0955c91ba9d5982311 Mon Sep 17 00:00:00 2001 From: senmiaoliu Date: Fri, 31 Mar 2023 13:37:36 +0800 Subject: [PATCH] use catalog first --- .../apache/kyuubi/engine/flink/session/FlinkSessionImpl.scala | 2 +- .../apache/kyuubi/engine/spark/session/SparkSessionImpl.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/externals/kyuubi-flink-sql-engine/src/main/scala/org/apache/kyuubi/engine/flink/session/FlinkSessionImpl.scala b/externals/kyuubi-flink-sql-engine/src/main/scala/org/apache/kyuubi/engine/flink/session/FlinkSessionImpl.scala index 75087b48ca2..ea9e885f42f 100644 --- a/externals/kyuubi-flink-sql-engine/src/main/scala/org/apache/kyuubi/engine/flink/session/FlinkSessionImpl.scala +++ b/externals/kyuubi-flink-sql-engine/src/main/scala/org/apache/kyuubi/engine/flink/session/FlinkSessionImpl.scala @@ -57,7 +57,7 @@ class FlinkSessionImpl( override def open(): Unit = { executor.openSession(handle.identifier.toString) - normalizedConf.foreach { + normalizedConf.toSeq.sortBy(!_._1.equals("use:catalog")).foreach { case ("use:catalog", catalog) => val tableEnv = sessionContext.getExecutionContext.getTableEnvironment try { diff --git a/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/session/SparkSessionImpl.scala b/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/session/SparkSessionImpl.scala index 78164ff5fab..5752b129f6d 100644 --- a/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/session/SparkSessionImpl.scala +++ b/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/session/SparkSessionImpl.scala @@ -54,7 +54,7 @@ class SparkSessionImpl( private val sessionEvent = SessionEvent(this) override def open(): Unit = { - normalizedConf.foreach { + normalizedConf.toSeq.sortBy(!_._1.equals("use:catalog")).foreach { case ("use:catalog", catalog) => try { SparkCatalogShim().setCurrentCatalog(spark, catalog)