This is an automated email from the ASF dual-hosted git repository.
ruifengz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new 58f2897809b [SPARK-42615][CONNECT][FOLLOWUP] Fix
SparkConnectAnalyzeHandler to use withActive
58f2897809b is described below
commit 58f2897809b5ead9a08565218d327b8a11caa64c
Author: Takuya UESHIN <[email protected]>
AuthorDate: Fri Mar 3 10:29:21 2023 +0800
[SPARK-42615][CONNECT][FOLLOWUP] Fix SparkConnectAnalyzeHandler to use
withActive
### What changes were proposed in this pull request?
Fix `SparkConnectAnalyzeHandler` to use `withActive`.
### Why are the changes needed?
Similar to #40165, `SQLConf.get` is necessary when transforming the proto
to plans.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Existing tests.
Closes #40261 from ueshin/issues/SPARK-42615/withActive.
Authored-by: Takuya UESHIN <[email protected]>
Signed-off-by: Ruifeng Zheng <[email protected]>
---
.../spark/sql/connect/service/SparkConnectAnalyzeHandler.scala | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git
a/connector/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectAnalyzeHandler.scala
b/connector/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectAnalyzeHandler.scala
index 90981f5b7ba..f6adcd852e8 100644
---
a/connector/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectAnalyzeHandler.scala
+++
b/connector/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectAnalyzeHandler.scala
@@ -37,10 +37,11 @@ private[connect] class SparkConnectAnalyzeHandler(
SparkConnectService
.getOrCreateIsolatedSession(request.getUserContext.getUserId,
request.getClientId)
.session
-
- val response = process(request, session)
- responseObserver.onNext(response)
- responseObserver.onCompleted()
+ session.withActive {
+ val response = process(request, session)
+ responseObserver.onNext(response)
+ responseObserver.onCompleted()
+ }
}
def process(
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]