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

   Relates to:
   
   #17379
   
   ## Rationale for this change
   
   Named parameter matching in DataFusion currently requires exact case 
matching between parameter names in function signatures and argument names in 
function calls. This is inconsistent with SQL identifier rules where unquoted 
identifiers are case-insensitive.
   
   For example, these calls should all work identically:
   - `substr(str => 'hello', start_pos => 1)`
   - `substr(STR => 'hello', START_POS => 1)`
   - `substr(Str => 'hello', Start_Pos => 1)`
   
   This change makes named parameter matching case-insensitive, aligning with 
standard SQL identifier behavior.
   
   ## What changes are included in this PR?
   
   - Modified `resolve_function_arguments` in 
`datafusion/expr/src/arguments.rs` to perform case-insensitive matching by 
converting both parameter names and argument names to lowercase before 
comparison
   - Updated HashMap parameter lookup to use lowercase keys
   - Added unit test `test_case_insensitive_parameter_matching` to verify the 
behavior
   - Updated sqllogictest to verify case-insensitive matching works with quoted 
identifiers
   
   ## Are these changes tested?
   
   Yes:
   - Unit test `test_case_insensitive_parameter_matching` verifies 
case-insensitive matching with various case combinations and argument reordering
   - Existing tests in `named_arguments.slt` verify the feature works 
end-to-end with real SQL queries
   - Test coverage includes uppercase, lowercase, and mixed-case parameter names
   
   ## Are there any user-facing changes?
   
   Yes - this is a user-facing enhancement:
   - Users can now use named parameters with any casing (e.g., `START_POS`, 
`start_pos`, `Start_Pos` all match the parameter `start_pos`)
   - This makes named parameters more user-friendly and consistent with SQL 
identifier conventions
   - No breaking changes - all existing queries continue to work
   


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