ulysses-you commented on code in PR #4323:
URL: https://github.com/apache/kyuubi/pull/4323#discussion_r1105274330


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/trino/api/TrinoContext.scala:
##########
@@ -140,15 +142,17 @@ object TrinoContext {
   def buildTrinoResponse(qr: QueryResults, trinoContext: TrinoContext): 
Response = {
     val responseBuilder = Response.ok(qr)
 
-    trinoContext.catalog.foreach(
-      responseBuilder.header(TRINO_HEADERS.responseSetCatalog, _))
-    trinoContext.schema.foreach(
-      responseBuilder.header(TRINO_HEADERS.responseSetSchema, _))
+    // Note, We have injected kyuubi session id to session context so that the 
next query can find
+    // the previous session to restore the query context.
+    // It's hard to follow the Trino style that set all context to http 
headers.
+    // Because we do not know the context at server side. e.g. `set k=v`, `use 
database`.
+    // We also can not inject other session context into header before we 
supporting to map
+    // query result to session context.

Review Comment:
   cc @iodone  
   We can not inject session context using the current request header. e.g. the 
current query is `set k=v2` but he exists request header is `k=v`. So we only 
inject kyuubi session id to help next query find session context.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to