morrySnow commented on code in PR #64366:
URL: https://github.com/apache/doris/pull/64366#discussion_r3604899835
##########
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 from_unixtime(20) LIKE
from_unixtime(20) across timezone changes.
##########
fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java:
##########
@@ -4290,6 +4292,11 @@ public void setTimeZone(String timeZone) {
this.timeZone = timeZone;
}
+ public void checkTimeZone(String timeZone) throws DdlException {
+ TimeUtils.checkTimeZoneValidAndStandardize(timeZone);
+ ZoneId.of(timeZone, TimeUtils.timeZoneAliasMap);
Review Comment:
Fixed in 933563ac2d0. The time_zone variable now uses a VarAttr setter that
stores the canonical result returned by checkTimeZoneValidAndStandardize, while
the checker validates that canonical value with ZoneId. Tests cover +8:00 being
stored as +08:00, including the SET_VAR path.
##########
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 the common
FoldConstantRuleOnFE rewrite entry rather than only visitBoundFunction, so
specialized time-function visitors are covered as well. Added a two-execution
now(kint) unit test verifying each unchanged nondeterministic result disables
SQL-cache processing.
--
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]