Gabriel39 commented on code in PR #67980:
URL: https://github.com/apache/doris/pull/67980#discussion_r4011640123
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/implementation/AggregateStrategies.java:
##########
@@ -693,6 +693,15 @@ private LogicalAggregate<? extends Plan>
storageLayerAggregate(
return canNotPush;
}
+ // File MIN/MAX retains only source endpoints. A cast can turn both
endpoints into NULL
+ // while an interior value remains valid. Ignore source nullability
when checking the cast
+ // itself, so safe widening casts over nullable columns can still use
metadata.
+ if (logicalScan instanceof LogicalFileScan &&
argumentsOfAggregateFunction.stream()
Review Comment:
Addressed in 88cde1a419 and synchronized to #67979 (c96aa1efea). The guard
now covers MIN/MAX on both OLAP and file scans after projection aliases are
resolved. Added direct/projected OLAP unit coverage across nullable and strict
modes, plus a DUP_KEYS regression comparing pushdown on/off and retaining
raw-column/safe-cast positive controls. The OLAP unit test failed before this
change and passes on both branches after it. COUNT-only behavior is unchanged.
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/implementation/AggregateStrategies.java:
##########
@@ -693,6 +693,15 @@ private LogicalAggregate<? extends Plan>
storageLayerAggregate(
return canNotPush;
}
+ // File MIN/MAX retains only source endpoints. A cast can turn both
endpoints into NULL
+ // while an interior value remains valid. Ignore source nullability
when checking the cast
+ // itself, so safe widening casts over nullable columns can still use
metadata.
+ if (logicalScan instanceof LogicalFileScan &&
argumentsOfAggregateFunction.stream()
+ .anyMatch(argument -> argument instanceof Cast
+ && Cast.castNullable(false,
argument.child(0).getDataType(), argument.getDataType()))) {
Review Comment:
Addressed in 88cde1a419 and synchronized to #67979. The guard now rejects
floating-source casts and DECIMAL-to-FLOAT casts in addition to NULL-producing
casts. Added DOUBLE-to-FLOAT and Decimal256-to-FLOAT unit cases, and a
single-file Paimon fixture containing +0.0 and -1e-320 with
signbit(MIN/MAX(CAST(... AS FLOAT))) comparisons. Native routing is asserted
explicitly. Both branches pass targeted FE tests and Checkstyle; the Paimon
end-to-end run remains unverified because the local FE connection was refused.
--
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]