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

   ## Which issue does this PR close?
   
   - Closes N/A
   
   ## Rationale for this change
   
   `SparkElt::coerce_types` validates that ELT receives at least 2 arguments 
(index + value1), but the error was never returned: it was built with 
`plan_datafusion_err!(...)` as an expression statement whose value was 
discarded. Since `DataFusionError` is not `#[must_use]`, the compiler didn't 
warn, so the function fell through and continued with fewer arguments than 
required instead of failing with a clear plan-time error.
   
   ## What changes are included in this PR?
   
   In datafusion/spark/src/function/string/elt.rs, the argument-count check is 
wrapped in return Err(plan_datafusion_err!(...)) so the validation actually 
short-circuits when fewer than 2 arguments are provided.
   
   ## Are these changes tested?
   
   This change restores an error path that was previously dropped silently. 
ELT's normal behavior is already covered by the existing tests in elt.rs. The 
invalid-arity branch had no coverage because it was never actually exercised.
   
   ## Are there any user-facing changes?
   
   ELT now returns a plan-time error when invoked with fewer than 2 arguments, 
instead of silently continuing. No public API changes.
   


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