Skip to content

Conversation

@wmTJc9IK0Q
Copy link

This adds a new BindArgumentsContext field to the tableFunction struct to allow table UDFs to retrieve values from the query context.

This was easier to make as a non-breaking change unlike the previous #53 and doesn't change the ability to use this context during the Fill* funcs if necessary.

Copilot AI review requested due to automatic review settings November 15, 2025 00:40
Copilot finished reviewing on behalf of wmTJc9IK0Q November 15, 2025 00:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds context support to table UDFs by introducing a new BindArgumentsContext field to the tableFunction struct. This allows table UDFs to retrieve values from the query context, similar to how scalar UDFs already have this capability.

  • Adds BindArgumentsContext field to tableFunction struct for context-aware binding
  • Updates wrapper functions to handle both BindArguments and BindArgumentsContext
  • Modifies bind logic to prioritize BindArgumentsContext when available, falling back to BindArguments
  • Introduces tableFuncContext struct to pass context store to bind functions

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
table_udf.go Adds BindArgumentsContext field to tableFunction, updates wrappers to support both bind methods, extracts and loads context from connection during binding
table_udf_test.go Adds contextTableUDF test implementation and TestContextTableUDF to verify context values can be passed to table UDFs

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@taniabogatsch
Copy link
Collaborator

Out of curiosity - is the copilot review something you enabled in your settings? I.e., I can't seem to find anything related to that on the repository level and AFAIK I did not enable it. 🤔

@VGSML
Copy link

VGSML commented Nov 17, 2025

Yes, it's the private copilot, I also have it.

@wmTJc9IK0Q
Copy link
Author

Didn't realize it would trigger on other people's repos, that's interesting. But yes, I have a subscription so that's why it got triggered.

Any feedback on this version of the change? I think it's pretty straightforward and in line with the scalar UDF one

@taniabogatsch
Copy link
Collaborator

Code looks good - could you have a look at the failing tests?

@VGSML
Copy link

VGSML commented Nov 20, 2025

@wmTJc9IK0Q Looks really good!

@wmTJc9IK0Q
Copy link
Author

@taniabogatsch Fixed. Thanks.

@taniabogatsch taniabogatsch merged commit cc449fe into duckdb:main Nov 22, 2025
17 checks passed
@taniabogatsch
Copy link
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants