morrySnow commented on code in PR #64366:
URL: https://github.com/apache/doris/pull/64366#discussion_r3604899288


##########
be/src/service/point_query_executor.cpp:
##########
@@ -308,6 +321,7 @@ Status PointQueryExecutor::init(const 
PTabletKeyLookupRequest* request,
     _tablet = DORIS_TRY(ExecEnv::get_tablet(request->tablet_id()));
     if (cache_handle != nullptr) {
         _reusable = cache_handle;
+        _reusable->update_runtime_state(*request);

Review Comment:
   Fixed in 933563ac2d0. Added a per-Reusable execution lease held by 
PointQueryExecutor from runtime/expression refresh through result output, so 
overlapping requests for the same UUID cannot mutate or evaluate the shared 
RuntimeState/VExpr tree concurrently. Added barrier-based overlap coverage.



##########
fe/fe-core/src/main/java/org/apache/doris/planner/GroupCommitPlanner.java:
##########
@@ -227,6 +250,7 @@ public static void executeGroupCommitInsert(ConnectContext 
ctx, PreparedStatemen
             List<Expr> valueExprs = 
statementContext.getIdToPlaceholderRealExpr().values().stream()
                     .map(v -> ((Literal) 
v).toLegacyLiteral()).collect(Collectors.toList());
             List<InternalService.PDataRow> rows = 
getRows(groupCommitPlanner.targetColumnSize, valueExprs);
+            groupCommitPlanner.refreshQueryGlobals(statementContext);

Review Comment:
   Fixed in 933563ac2d0. The cached group-commit fast path now reapplies 
SET_VAR hints before fastAnalyzeGroupCommit and query-global refresh. Added a 
two-execution unit test that restores the base session value between executions 
and verifies the cached execution reapplies the timezone hint.



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/FoldConstantRuleOnFE.java:
##########
@@ -547,6 +572,132 @@ public Expression visitTryCast(TryCast cast, 
ExpressionRewriteContext context) {
         }
     }
 
+    @Override
+    public Expression visitNow(Now now, ExpressionRewriteContext context) {
+        now = rewriteChildren(now, context);
+        Optional<Expression> checkedExpr = preProcess(now);
+        if (checkedExpr.isPresent()) {
+            return checkedExpr.get();
+        }
+        Optional<Instant> statementStartTime = getStatementStartTime(context);
+        Optional<ZoneId> statementTimeZone = getStatementTimeZone(context);
+        Optional<Integer> precision = getIntegerPrecision(now);
+        if (!statementStartTime.isPresent() || !statementTimeZone.isPresent() 
|| !precision.isPresent()) {
+            return now;

Review Comment:
   Fixed in 933563ac2d0. SQL-cache bookkeeping now wraps FoldConstantRuleOnFE's 
common rewrite entry rather than only visitBoundFunction, so specialized 
time-function visitors are covered as well. Added a two-execution  unit test 
verifying each unchanged nondeterministic result disables SQL-cache processing.



##########
be/src/exprs/vexpr.cpp:
##########
@@ -836,6 +836,13 @@ Status VExpr::get_const_col(VExprContext* context,
     return Status::OK();
 }
 
+void VExpr::reset_constant_col() {
+    _constant_col.reset();

Review Comment:
   Fixed in 933563ac2d0. Reusable point-query expressions are now rebuilt after 
refreshing request globals, which recreates FunctionContext constant wrappers 
and thread-local function state instead of only clearing VExpr constant 
columns. The point-query regression now covers nested  across timezone changes.



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