kyuubi/docs/deployment
liangzhaoyuan 9a0c49e791
[KYUUBI #7138] Respect kyuubi.session.engine.spark.initialize.sql set by cllient in shared engine mode
### Why are the changes needed?
<img width="1860" height="908" alt="image" src="https://github.com/user-attachments/assets/ec445237-be62-405f-992e-56e10156407f" />
**Current Behavior:**

When "kyuubi.engine.share.level = USER/GROUP/SERVER", the first client (Client A) calling openSession creates a Kyuubi-Spark-SQL-Engine (Spark Driver), where the initialization SQL configured in "kyuubi.session.engine.spark.initialize.sql" takes effect.

Subsequent clients (e.g., Client B) connecting via openSession will reuse the existing Kyuubi-Spark-SQL-Engine (Spark Driver) created in step 1, where the initialization SQL configured in "kyuubi.session.engine.spark.initialize.sql" becomes ineffective.

**Why This Capability Is Needed:**

Currently, kyuubi.session.engine.spark.initialize.sql only applies to the first openSession client. All subsequent SQL operations inherit the initialization SQL configuration from the first client (this appears to be a potential bug).

Client A may need to set "USE dbA" in its current SQL context, while Client B may need "USE dbB" in its own context - such scenarios should be supported.

### How was this patch tested?
Tested on local Kyuubi/Spark cluster. No existing unit tests cover this scenario. Please point me to any relevant tests so I can add them

### Was this patch authored or co-authored using generative AI tooling?
No

Closes #7138 from 1358035421/lc/spark_session_init_sql.

Closes #7138

338d8aace [Cheng Pan] remove dash
1beecc456 [Cheng Pan] fix
6c7f9a13e [liangzhaoyuan] update migration-guide.md
492adb6c4 [liangzhaoyuan] fix review comments
f0e9320be [1358035421] Merge branch 'master' into lc/spark_session_init_sql
021455322 [liangzhaoyuan] update migration-guide.md
b4e61cf89 [liangzhaoyuan] ut
ca4c71253 [Cheng Pan] Update externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/session/SparkSQLSessionManager.scala
da92544f1 [liangzhaoyuan] fix
c1a38d584 [liangzhaoyuan] Support executing kyuubi.session.engine.spark.initialize.sql on session initialization

Lead-authored-by: liangzhaoyuan <lwlzyl19940916@gmail.com>
Co-authored-by: Cheng Pan <chengpan@apache.org>
Co-authored-by: 1358035421 <13588035421@163.com>
Co-authored-by: Cheng Pan <pan3793@gmail.com>
Signed-off-by: Cheng Pan <chengpan@apache.org>
2025-08-04 14:46:05 +08:00
..
spark [KYUUBI #6900] [DOCS] Correct spelling errors in 'large_query_results' part 2025-01-23 19:48:11 +08:00
engine_lifecycle.md [KYUUBI #4200] [Improvement] [Docs] Introduce Markdown formatting with spotless-maven-plugin and flexmark for docs 2023-01-30 11:14:41 +08:00
engine_on_kubernetes.md [KYUUBI #6876] Support rolling spark.kubernetes.file.upload.path 2025-01-15 01:27:12 +08:00
engine_on_yarn.md [KYUUBI #7113] Skip Hadoop classpath check if flink-shaded-hadoop jar exists in Flink lib directory 2025-07-02 17:33:07 +08:00
engine_share_level.md [KYUUBI #7118] docs(client): Add comprehensive docs for Engine Pool feature 2025-07-09 17:34:06 +08:00
high_availability_guide.md [KYUUBI #6964] Fix typos in serveral docs 2025-03-12 14:02:24 +08:00
hive_metastore.md [KYUUBI #6986] [DOC] Fix multiple Pygments lexer name issues 2025-03-17 16:06:08 +08:00
index.rst [KYUUBI #5154] [Doc] Move configuration docs to the top level 2023-08-11 18:23:08 +08:00
kyuubi_on_kubernetes.md [KYUUBI #6939] Bump Spark 3.5.5 2025-03-03 13:42:09 +08:00
migration-guide.md [KYUUBI #7138] Respect kyuubi.session.engine.spark.initialize.sql set by cllient in shared engine mode 2025-08-04 14:46:05 +08:00