sandy-sachin7 opened a new pull request, #23059:
URL: https://github.com/apache/datafusion/pull/23059

   ## Which issue does this PR close?
   
   - Closes #22952.
   
   ## Rationale for this change
   
   The type coercion and simplification applied to table function arguments in 
`get_table_function_source` can fail for custom table function expressions 
(e.g., `tbf(a='x', b='x')`), breaking user-facing SQL. The error propagates 
before the table function implementation ever sees the arguments.
   
   ## What changes are included in this PR?
   
   1. **Non-fatal coercion/simplification** (`session_state.rs`): If `coerce()` 
or `simplify()` fails for a particular argument, fall back to the original raw 
expression instead of propagating the error. Existing built-in functions 
continue to get successfully coerced/simplified arguments as before.
   
   2. **`raw_exprs()` accessor** (`table.rs`): Added to `TableFunctionArgs` so 
that table function implementations can access the original, unprocessed 
arguments when needed. Added `new_with_raw()` constructor for this purpose.
   
   ## Are these changes tested?
   
   Covered by existing tests:
   - `test_udtf_type_coercion` - type coercion still works when it can succeed
   - `test_simple_read_csv_udtf` - basic UDTF functionality intact
   - `generate_series` tests - simplification path still works
   - `type_coercion` sqllogictests pass
   
   ## Are there any user-facing changes?
   
   Yes - custom table function implementations can now use `args.raw_exprs()` 
to access original expression arguments. No breaking changes to existing APIs.


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