github-actions[bot] commented on code in PR #64366:
URL: https://github.com/apache/doris/pull/64366#discussion_r3519173362


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/load/NereidsLoadPlanInfoCollector.java:
##########
@@ -276,14 +280,18 @@ public NereidsLoadPlanInfoCollector(OlapTable destTable, 
NereidsLoadTaskInfo tas
     public LoadPlanInfo collectLoadPlanInfo(LogicalPlan logicalPlan, 
DescriptorTable descTable,
             TupleDescriptor scanDescriptor) {
         this.logicalPlan = logicalPlan;
-        CascadesContext cascadesContext = CascadesContext.initContext(new 
StatementContext(),
+        CascadesContext cascadesContext = 
CascadesContext.initContext(createTaskStatementContext(),
                 logicalPlan, PhysicalProperties.ANY);
         PlanTranslatorContext context = new 
PlanTranslatorContext(cascadesContext, descTable);
         loadPlanInfo.destTuple = scanDescriptor;
         logicalPlan.accept(this, context);
         return loadPlanInfo;
     }
 
+    StatementContext createTaskStatementContext() {
+        return new StatementContext(ConnectContext.get(), null, 
statementStartTime);
+    }

Review Comment:
   This context carries the load task instant, but it still resolves 
statement-time timezone through the current thread `ConnectContext`, not the 
load request. Partition pruning folds predicates through 
`FoldConstantRuleOnFE`, whose current-date/time visitors call 
`DateUtils.getTimeZone()`; stream load can independently set 
`NereidsStreamLoadTask.timezone`, and `createQueryGlobals()` sends 
`taskInfo.getTimezone()` to BE. With a session/thread timezone of `+08:00` and 
a stream-load header `time_zone='+00:00'`, `dt = current_date()` can prune the 
`+08:00` date partition while BE evaluates the same statement instant in 
`+00:00`, dropping or rejecting valid rows near a day boundary. Please carry 
the task timezone into this pruning/folding context, or temporarily install and 
restore it with the task statement context, so FE pruning and BE execution use 
the same instant and timezone.



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