HappenLee commented on code in PR #68672:
URL: https://github.com/apache/doris/pull/68672#discussion_r4164583439
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Cast.java:
##########
@@ -93,6 +93,17 @@ protected Cast(List<Expression> child, DataType targetType,
boolean isExplicitTy
this.isStrict = isStrict;
}
+ @Override
+ public boolean isDeterministic() {
+ // TIME has no date. These casts supply the date from the current
query's clock.
+ return child().isNullLiteral() || !(child().getDataType().isTimeType()
&& targetType.isDateLikeType());
Review Comment:
Fixed in d78bb71e44213a9341a1d4d50afa15d2e32db99b. `Cast.isDeterministic()`
now recursively checks source/target ARRAY elements, MAP keys and values, and
STRUCT fields, including deeper nesting. Known-NULL inputs still reach existing
NULL folding and legality checks; stable nested conversions remain cacheable.
Added expression and SQL/query/condition-cache planner tests. The new tests
reproduced the gap before the fix. All 102 targeted FE tests and the FE
build/Checkstyle pass. Runtime regression verifies zero BE condition-cache
lookups for ARRAY/MAP/STRUCT TIME casts at batch sizes 1 and 1024; generated
output was independently verified.
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java:
##########
@@ -949,6 +947,8 @@ private PlanFragment
computePhysicalOlapScan(PhysicalOlapScan olapScan, PlanTran
Review Comment:
Fixed in d78bb71e44213a9341a1d4d50afa15d2e32db99b. Runtime-filter
translation now applies the shared eligibility check to each target probe,
including the implicit cast to the build-side type. This covers singleton and
grouped filters, including grouped targets that skip pruning metadata, and only
downgrades the scan's existing flag.
Tests cover the actual Join plan, explicit/implicit probe casts, grouped
targets, and deterministic probes. The new tests reproduced the gap before the
fix. The BE regression executes the TIME-cast join twice with zero
condition-cache lookups; the deterministic control still has
ConditionCacheHit=1 and filters 79,872 rows. All 102 targeted FE tests, the FE
build/Checkstyle, and three regression suites pass.
--
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]