bubulalabu opened a new pull request, #19230: URL: https://github.com/apache/datafusion/pull/19230
## Which issue does this PR close? no issue, it's a follow up PR for https://github.com/apache/datafusion/pull/18535 ## Rationale for this change Table functions currently only support positional arguments. This PR adds support for named parameters (e.g., `batched_generate_series(stop => 5, start => 1)`) to match the functionality already available for scalar, aggregate, and window functions. ## What changes are included in this PR? - Added `signature()` method to `BatchedTableFunctionSource` trait to expose parameter names - Updated SQL parsing in both `TableFactor::Table` and `TableFactor::Function` paths to preserve parameter names from the AST - Updated LATERAL join parsing to handle named parameters - Reused existing `resolve_function_arguments()` infrastructure to validate and reorder arguments - Added parameter names to `batched_generate_series` function - Extended test coverage in `named_arguments.slt` with batched table function tests, including LATERAL joins ## Are these changes tested? Yes. Added comprehensive tests covering: - Named arguments in correct order - Named arguments in reversed order - Mixed positional and named arguments - Error cases (positional after named, unknown parameters, duplicates) - LATERAL joins with named parameters - Case-insensitive parameter names ## Are there any user-facing changes? Yes. Users can now call batched table functions with named parameters: ```sql -- Arguments can be specified out of order SELECT * FROM batched_generate_series(stop => 10, start => 1); -- Mix positional and named (positional must come first) SELECT * FROM batched_generate_series(1, stop => 10); -- Works in LATERAL joins too SELECT t.id, value FROM my_table t CROSS JOIN LATERAL batched_generate_series(start => t.start_col, stop => t.end_col); ``` This is purely additive - existing positional argument calls continue to work as before. -- 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]
