Provide session to the udtf call#20222
Merged
martin-g merged 2 commits intoapache:mainfrom Mar 30, 2026
Merged
Conversation
07e04ef to
d8ec751
Compare
Contributor
Author
|
@LLDay please, review. |
martin-g
reviewed
Feb 9, 2026
ade9992 to
7f54d06
Compare
martin-g
reviewed
Feb 9, 2026
LLDay
reviewed
Feb 9, 2026
94a61cb to
89cb8ed
Compare
e5a986a to
dcb159a
Compare
dcb159a to
604e847
Compare
9e2b58d to
f96b566
Compare
Contributor
Author
|
@alamb Hi! Could you check this PR please? |
martin-g
reviewed
Mar 29, 2026
2135941 to
b9cc188
Compare
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.
b9cc188 to
5f80ad0
Compare
Contributor
Author
|
@martin-g Thank you! All resolved comments are applied as suggested. |
martin-g
reviewed
Mar 29, 2026
datafusion/catalog/src/table.rs
Outdated
| /// Describes arguments provided to the table function call. | ||
| pub struct TableFunctionArgs<'e, 's> { | ||
| /// Call arguments. | ||
| pub exprs: &'e [Expr], |
Member
There was a problem hiding this comment.
Remove pub for the fields.
Or make the struct #[non_exhaustive].
Member
Thank you, @askalt ! Please don't use force pushes. It makes it harder to make incremental reviews. |
martin-g
approved these changes
Mar 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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?
TableFunctionImpl::call_with_args: it takes structTableFunctionArgs, doing arguments extendable without breaking backward compatibility.TableFunctionImpl::call.call_with_argsfor each UDTF in DF.table_list()that depends on the session state.