Gabriel39 commented on code in PR #70216:
URL: https://github.com/apache/doris/pull/70216#discussion_r4489497567


##########
fe/fe-core/src/main/java/org/apache/doris/connector/ConnectorSessionBuilder.java:
##########
@@ -252,6 +252,16 @@ private static ConnectorDelegatedCredential 
toConnectorCredential(DelegatedCrede
      * Server-level globals (e.g., lower_case_table_names) are also included.
      */
     private static Map<String, String> extractSessionProperties(ConnectContext 
ctx) {
+        // Once per statement: the session variables, SET_VAR hints included, 
are settled before the
+        // first session is built during plan translation. Shared as is: a 
session only reads them.
+        StatementContext statementContext = ctx.getStatementContext();
+        if (statementContext == null) {
+            return readSessionProperties(ctx);
+        }
+        return statementContext.getOrComputeConnectorSessionProperties(() -> 
readSessionProperties(ctx));

Review Comment:
   Fixed in 0960f9e5ae4. StatementContext.invalidCache now drops the memoized 
connector export, so a SET_VAR hint parsed after the view metadata session 
reaches subsequent scan sessions. Exports also track their SessionVariable 
instance: internal-view guards that replace and restore the instance refresh 
subsequent exports even without per-key invalidation. Existing sessions retain 
immutable snapshots and the same connector statement scope. The parser 
regression captures a metadata session before parsing the Hive JSON hint, 
verifies false-to-true-to-false values, and preserves prior snapshots and scope 
ownership. A second regression covers scoped variable replacement/restoration 
and fails with key invalidation alone. Fresh compilation plus six focused 
suites passed all 114 tests; FE Checkstyle and clang-format 16 also pass. 
Validation used the existing reactor classpath; full FE reactor and external 
Hive query execution remain for CI.



-- 
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