Baymine opened a new pull request, #65918:
URL: https://github.com/apache/doris/pull/65918

   ### What problem does this PR solve?
   
   Issue Number: close #65917
   
   Problem Summary:
   
   The nereids `date_format` scalar function declared its nullability via 
`PropagateNullable`, meaning FE inferred the result as non-nullable whenever 
both inputs were non-nullable. However, the BE implementation can return NULL 
for non-null input (e.g. invalid or edge-case format strings), so FE's inferred 
nullability was wrong and mismatched BE. This could lead to incorrect 
nullability metadata being propagated through the plan, causing wrong results 
or crashes when the BE actually produced NULLs.
   
   The fix switches `date_format`'s nullability from `PropagateNullable` to 
`AlwaysNullable`, so FE always treats the result as nullable, matching the BE 
behavior. This mirrors the existing treatment of the sibling `str_to_date` 
function, which already uses `AlwaysNullable` for the same reason (and the 
`AlwaysNullable` interface javadoc itself lists `date_format` as an example).
   
   ### Release note
   
   Fixed a nullability mismatch for the `date_format` function: the result is 
now correctly treated as nullable by FE, matching BE behavior.
   
   ### Check List (For Author)
   
   - Test
       - [x] Unit Test
   - Behavior changed:
       - [x] Yes. The `date_format` function result is now always nullable in 
FE (was non-nullable when both inputs were non-nullable), matching BE.
   - Does this need documentation?
       - [x] 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]

Reply via email to