Skip to content

Provide session to the udtf call#20222

Open
askalt wants to merge 1 commit intoapache:mainfrom
tarantool:askalt/provide-state-to-udtf
Open

Provide session to the udtf call#20222
askalt wants to merge 1 commit intoapache:mainfrom
tarantool:askalt/provide-state-to-udtf

Conversation

@askalt
Copy link
Contributor

@askalt askalt commented Feb 8, 2026

Rationale for this change

In our project, we have several UDTFs that depend on the session from which they are called -- for example, functions to list views, tables and functions that wrap scan of another table (like composition). To implement them, we need a way to provide the current session state to the UDTF. It would be nice to add the session as an argument to the UDTF call.

What changes are included in this PR?

  1. Introduce TableFunctionImpl::call_with_args: it takes struct TableFunctionArgs, doing arguments extendable without breaking backward compatibility.
  2. Deprecate TableFunctionImpl::call.
  3. Switch to call_with_args for each UDTF in DF.
  4. Add an example of the UDTF table_list() that depends on the session state.

@github-actions github-actions bot added documentation Improvements or additions to documentation core Core DataFusion crate catalog Related to the catalog crate functions Changes to functions implementation ffi Changes to the ffi crate labels Feb 8, 2026
@askalt askalt force-pushed the askalt/provide-state-to-udtf branch 2 times, most recently from cd24dcd to 07e04ef Compare February 8, 2026 17:14
This patch adds the passing of the current session to the UDTF call.
This helps implement session-dependent functions, for example, a function
that returns the list of registered tables.
@askalt askalt force-pushed the askalt/provide-state-to-udtf branch from 07e04ef to d8ec751 Compare February 8, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

catalog Related to the catalog crate core Core DataFusion crate documentation Improvements or additions to documentation ffi Changes to the ffi crate functions Changes to functions implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant