From 0b537033fc877845135bfdb78cf7410e0870e446 Mon Sep 17 00:00:00 2001 From: zwangsheng Date: Fri, 8 Mar 2024 20:38:37 +0800 Subject: [PATCH] [KYUUBI #6147][TRINO] Use the overlay conf as session conf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # :mag: Description ## Issue References ๐Ÿ”— This pull request fixes #6147 ## Describe Your Solution ๐Ÿ”ง Overwriting the engine conf with the passed conf consider as the full session conf. ## 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 None --- # 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 #6148 from zwangsheng/KYUUBI#6147. Closes #6147 3e0fb0fb6 [Cheng Pan] Update externals/kyuubi-trino-engine/src/main/scala/org/apache/kyuubi/engine/trino/session/TrinoSessionImpl.scala 452224e00 [zwangsheng] fix comments 4ee7c042b [zwangsheng] [KYUUBI #6147][TRINO] Using the overlay conf as session conf Lead-authored-by: zwangsheng Co-authored-by: Cheng Pan Signed-off-by: Cheng Pan (cherry picked from commit f5b89b0945b4911b1d73d24724e81ca554a588ef) Signed-off-by: Cheng Pan --- .../kyuubi/engine/trino/session/TrinoSessionImpl.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/externals/kyuubi-trino-engine/src/main/scala/org/apache/kyuubi/engine/trino/session/TrinoSessionImpl.scala b/externals/kyuubi-trino-engine/src/main/scala/org/apache/kyuubi/engine/trino/session/TrinoSessionImpl.scala index 972c76bf6be..8080df79979 100644 --- a/externals/kyuubi-trino-engine/src/main/scala/org/apache/kyuubi/engine/trino/session/TrinoSessionImpl.scala +++ b/externals/kyuubi-trino-engine/src/main/scala/org/apache/kyuubi/engine/trino/session/TrinoSessionImpl.scala @@ -49,7 +49,11 @@ class TrinoSessionImpl( sessionManager: SessionManager) extends AbstractSession(protocol, user, password, ipAddress, conf, sessionManager) { - val sessionConf: KyuubiConf = sessionManager.getConf + val sessionConf: KyuubiConf = { + val engineConf = sessionManager.getConf.clone + conf.foreach { case (k, v) => engineConf.set(k, v) } + engineConf + } override val handle: SessionHandle = conf.get(KYUUBI_SESSION_HANDLE_KEY).map(SessionHandle.fromUUID).getOrElse(SessionHandle())