kyuubi/docs
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
..
_static/css Revert "[KYUUBI #5908] [DOCS] Remove workaround for malformed table" 2023-12-24 01:53:05 +08:00
appendix
client [KYUUBI #7118] docs(client): Add comprehensive docs for Engine Pool feature 2025-07-09 17:34:06 +08:00
configuration [KYUUBI #7141] Support to get spark app url with pattern http://{{SPARK_DRIVER_POD_IP}}:{{SPARK_UI_PORT}} 2025-07-21 10:11:07 +08:00
connector [KYUUBI #6986] [DOC] Fix multiple Pygments lexer name issues 2025-03-17 16:06:08 +08:00
contributing [KYUUBI #6987] [DOC] Fix Unknown target name issues 2025-03-17 16:05:18 +08:00
deployment [KYUUBI #7138] Respect kyuubi.session.engine.spark.initialize.sql set by cllient in shared engine mode 2025-08-04 14:46:05 +08:00
extensions [KYUUBI #7036] [DOCS] Improve docs for kyuubi-extension-spark-jdbc-dialect 2025-04-23 11:09:29 +08:00
imgs [KYUUBI #5914] Update layer diagram on welcome page 2023-12-25 16:13:48 +08:00
monitor [KYUUBI #7072] Expose metrics of engine startup permit state 2025-05-29 13:27:42 +08:00
overview [KYUUBI #6596] Fix typos in architecture page 2024-08-08 12:12:30 +00:00
quick_start [KYUUBI #7160] Use single try-with-resources blocks in docs example 2025-08-04 11:26:20 +08:00
security [KYUUBI #6924] Upgrade Spark Ranger plugin to 2.6.0 2025-07-02 17:31:21 +08:00
tools [KYUUBI #6969] [DOC] Fix "Title underline too short" issues 2025-03-10 12:10:48 +08:00
conf.py Revert "[KYUUBI #5908] [DOCS] Remove workaround for malformed table" 2023-12-24 01:53:05 +08:00
index.rst [KYUUBI #6970] [DOC] Fix "nonexisting document" issues 2025-03-10 12:11:17 +08:00
make.bat
Makefile
requirements.txt [KYUUBI #6752] [DOC] Bump doc build requirements 2024-10-18 10:39:02 +08:00