morrySnow opened a new pull request, #65319:
URL: https://github.com/apache/doris/pull/65319
### What problem does this PR solve?
Problem Summary: FE constant folding returned results that differed from
execution for several Nereids expressions. DATE and DATEV2 casts parsed the
whole datetime value and could round a valid max-date input past the DATETIMEV2
boundary before truncating to date. TIME values lost their sign when coerced to
DATETIMEV2 for TIMEDIFF folding, and TIMEDIFF had no FE executable
implementation. DecimalV3 zero values cast to string used BigDecimal scientific
notation instead of the target scale. STR_TO_DATE only inferred DATE for
literal format arguments, so constant dynamic formats such as CONCAT('%Y-',
'%j') kept DATETIMEV2 schema. FIELD used Java NaN comparison, unlike execution
where NaN matches NaN. This change aligns those FE folding paths with execution
and adds focused unit coverage.
### Release note
Fix FE constant folding results for several date/time, decimal, str_to_date,
and NaN FIELD expressions.
### Check List (For Author)
- Test: Unit Test
- ./run-fe-ut.sh --run
org.apache.doris.nereids.rules.expression.FoldConstantTest
- Behavior changed: Yes. FE constant folding now matches execution for the
covered expressions.
- Does this need documentation: No
--
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]