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

   ## Rationale for this change
   
   Named arguments currently require all parameters from the first to the last 
provided argument to be explicitly specified, even when middle parameters are 
optional and nullable. This forces verbose workarounds like `func(required1 => 
1, required2 => 'test', optional1 => NULL, optional2 => NULL, optional3 => 5)`` 
instead of the cleaner `func(required1 => 1, required2 => 'test', optional3 => 
5)`. 
   
   ## What changes are included in this PR?
   
   The core change modifies `datafusion/expr/src/arguments.rs` to automatically 
fill skipped optional parameters with NULL. Instead of requiring consecutive 
parameter filling from index 0 to args_len-1, the algorithm now finds the 
highest provided parameter index and fills any gaps with NULL expressions.
   
   ## Are these changes tested?
   
   Yes, extensively. I added unit and sqllogictests, which might be overkill. 
Please let me know what's preferred.
   
   ## Are there any user-facing changes?
   
   Yes, this is a user-facing enhancement. Users can now write cleaner SQL with 
named arguments by omitting middle optional parameters instead of providing 
explicit This change is fully backward compatible - all existing queries 
continue to work unchanged.


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