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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/implementation/AggregateStrategies.java:
##########
@@ -693,6 +693,20 @@ private LogicalAggregate<? extends Plan> 
storageLayerAggregate(
             return canNotPush;
         }
 
+        // File footers and OLAP zone maps retain only source endpoints. Casts 
that introduce NULL
+        // can discard a valid interior value. Check the cast independently of 
source nullability
+        // so safe widening casts over nullable columns remain eligible. 
Floating sources may have
+        // NaNs omitted by file statistics; DOUBLE/DECIMAL-to-FLOAT can also 
underflow to signed
+        // zero and change the MIN/MAX representative even without introducing 
NULL.
+        if ((functionClasses.contains(Min.class) || 
functionClasses.contains(Max.class))
+                && argumentsOfAggregateFunction.stream().anyMatch(argument -> 
argument instanceof Cast
+                        && (Cast.castNullable(false, 
argument.child(0).getDataType(), argument.getDataType())
+                                || 
argument.child(0).getDataType().isFloatLikeType()

Review Comment:
   [P2] Keep exact floating widenings eligible on OLAP scans. For the concrete 
plan
   
       Aggregate(MIN(CAST(f AS DOUBLE)))
         OlapScan(f FLOAT, DUP_KEYS)
   
   `castNullable(false, FLOAT, DOUBLE)` is false, but this shared 
source-is-float arm now removes the existing zone-map fast path and forces a 
full row scan. Unlike Parquet footers, Doris zone maps persist NaN and 
+/-infinity flags, and `ZoneMap::from_proto` restores them before 
`VStatisticsIterator` emits the extrema; FLOAT-to-DOUBLE is exact, 
order-preserving, and preserves signed zero. The blanket rejection is needed 
for `LogicalFileScan`, but the OLAP path only needs to reject lossy families 
such as DOUBLE-to-FLOAT (plus the existing null-producing cases). Please make 
this arm scan-specific and add direct/projected OLAP FLOAT-to-DOUBLE positive 
tests.



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