apache / apache/datafusion

Avoid breaking changes for table function args

Open
#22,952 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
9.3k
Forks
2.4k
Avg merge
3d 7h
Merged PRs (30d)
344

Description

### Describe the bug

We encountered several breaking changes for table function arguments. These changes break user-facing SQL.

We have some table functions like `tbf(a='x', b='x')`.

Last time someone added a simplifier to simplify argument expressions. This time someone added a change to coerce argument expressions https://github.com/apache/datafusion/pull/19915 (Our table functions will throw error during coercing). These changes break our table functions and we have to change our table function synatx and break our user-facing sql.
https://github.com/apache/datafusion/blob/d428760d709a375f3d997c84e9c4748a22584149/datafusion/core/src/execution/session_state.rs#L1966-L1999

It seems these changes could be moved into the table function implementation or a method of `TableFunctionArgs::simplified_args()`. We could pass the original argument expressions into the `TableFunctionImpl::call()` method and let users to choose whether to simplify args.

### To Reproduce

_No response_

### Expected behavior

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start in datafusion/core/src/execution/session_state.rs around lines 1966-1999, then inspect TableFunctionArgs::simplified_args() and TableFunctionImpl::call(). Trace where table-function argument expressions are simplified or coerced, and define the behavior needed to preserve original user-facing SQL while allowing implementations to choose whether to simplify arguments.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend-api-design
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.