hello-stephen commented on code in PR #71190:
URL: https://github.com/apache/doris/pull/71190#discussion_r4748830058


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/properties/SelectHintSetVar.java:
##########
@@ -50,13 +51,17 @@ public Map<String, Optional<String>> getParameters() {
      * @param context statement context
      */
     public void setVarOnceInSql(StatementContext context) {
-        SessionVariable sessionVariable = 
context.getConnectContext().getSessionVariable();
+        ConnectContext connectContext = context.getConnectContext();
+        SessionVariable sessionVariable = connectContext.getSessionVariable();
         // set temporary session value, and then revert value in the 'finally 
block' of StmtExecutor#execute
         sessionVariable.setIsSingleSetVar(true);
         for (Map.Entry<String, Optional<String>> kv : 
getParameters().entrySet()) {
             String key = kv.getKey();
             Optional<String> value = kv.getValue();
             if (value.isPresent()) {
+                if (connectContext.isSessionVarOverridden(key)) {

Review Comment:
   [P2] Preserve REFRESH timeout overrides across coupled setters
   
   For an IVM MV defined with `SELECT /*+ SET_VAR(max_execution_time=1000) */ 
...`, `REFRESH /*+ SET_VAR(query_timeout=3600) */ MATERIALIZED VIEW mv 
INCREMENTAL WITH DRY RUN` still gets `queryTimeoutS=1`. The two variables have 
different canonical names, so this guard permits the MV hint, while 
`SessionVariable.setMaxExecutionTimeMS(String)` also writes `queryTimeoutS`. 
Under default user timeout properties, a nonempty delta taking over one second 
can therefore time out despite the explicit one-hour REFRESH override 
(`CoordinatorContext.initQueryOptions` sends the overwritten timeout). Please 
protect these overlapping setters or reapply REFRESH overrides after MV hints, 
and add this conflict to the precedence tests.



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