This is an automated email from the ASF dual-hosted git repository.

mgrund pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark-connect-go.git


The following commit(s) were added to refs/heads/master by this push:
     new 5880ead  (FIX Issue #87) Correct Config to accurately set UserContext
5880ead is described below

commit 5880ead055a60c08193ab746827320c781999418
Author: Magnus Pierre <[email protected]>
AuthorDate: Thu Nov 7 21:36:14 2024 +0100

    (FIX Issue #87) Correct Config to accurately set UserContext
    
    The proto lacked userContext which led to not able to set values correctly 
for current session & user context.
    ### What changes were proposed in this pull request?
    client.Config() function proto lacked UserContext
    
    ### Why are the changes needed?
    photo requires a user context that was actually omitted in the development 
and was not caught since the call seemingly work, but does not set the value in 
the correct context.
    
    ### Does this PR introduce _any_ user-facing change?
    No
    
    ### How was this patch tested?
    Setting spark.sql.ansi.enabled to true (default false) and running a ansi 
violation cast as well as getting the value from spark.sql using set and using 
Config.Get in a golang application.
    
    Closes #88 from magpierre/Correct-spark.Config.Set-issue-.
    
    Authored-by: Magnus Pierre <[email protected]>
    Signed-off-by: Martin Grund <[email protected]>
---
 spark/client/client.go | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/spark/client/client.go b/spark/client/client.go
index 0d24bb4..37b1a55 100644
--- a/spark/client/client.go
+++ b/spark/client/client.go
@@ -332,7 +332,12 @@ func (s *sparkConnectClientImpl) SemanticHash(ctx 
context.Context, plan *proto.P
 }
 
 func (s *sparkConnectClientImpl) Config(ctx context.Context, operation 
*proto.ConfigRequest_Operation) (*generated.ConfigResponse, error) {
-       request := &proto.ConfigRequest{Operation: operation}
+       request := &proto.ConfigRequest{
+               Operation: operation,
+               UserContext: &proto.UserContext{
+                       UserId: "na",
+               },
+       }
        request.SessionId = s.sessionId
        resp, err := s.client.Config(ctx, request)
        if err != nil {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to