ujjwaltwri opened a new pull request, #19189:
URL: https://github.com/apache/datafusion/pull/19189

   Fixes #19171
   
   ### Problem
   
   The `concat` scalar function currently reports its result as **always 
nullable** at
   planning/schema time. However, its **runtime semantics** are:
   
   - `concat` ignores NULL inputs.
   - The result becomes NULL **only if all input arguments are NULL**.
   
   This mismatch causes incorrect nullability in inferred schemas and can affect
   optimizer behavior.
   
   ### What this PR does
   
   Implements `return_field_from_args` for `ConcatFunc` so that:
   
   1. The return `DataType` is derived using the existing `return_type` logic.
   2. The return field’s nullability is computed as:
   
   
   (If there are no argument fields, the return is considered nullable 
defensively.)
   
   This aligns schema-time nullability with runtime behavior and matches the
   semantics used by other SQL engines.
   
   ### Tests
   
   - All existing unit tests for `concat` pass.
   - Parquet & CSV tests verified locally after initializing test submodules.
   - No behavior changes to runtime concatenation: only planner-side metadata 
improved.
   
   ### Notes
   
   If CI finds any compatibility adjustments required across DataFusion crates,
   I will update this PR accordingly.
   


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