Skip to content

Conversation

Mytherin
Copy link
Collaborator

Fixes #11393

DuckDB has two types of table functions - table in-out functions and "standard" table functions. Standard table functions are more flexible/versatile and support e.g. parallel execution, but must operate on constant input parameters. Currently, when trying to use a lateral join column with such a function, the column is interpreted as a varchar instead which provides a confusing error message. In this PR, we try to bind such columns using the lateral join binder, and if we find a matching candidate we throw a more descriptive error message.

For example, after this PR:

D WITH t1(a) AS (SELECT 7) SELECT * FROM t1, generate_series(1, a);
-- Binder Error: Table function "generate_series" does not support lateral join column parameters - cannot use column "a" in this context

… join column in a table function that does not support it
@Mytherin Mytherin merged commit 472271c into duckdb:main Mar 31, 2024
github-actions bot pushed a commit to duckdb/duckdb-r that referenced this pull request Mar 31, 2024
Merge pull request duckdb/duckdb#11436 from Mytherin/improvelateralerror
@Mytherin Mytherin deleted the improvelateralerror branch June 7, 2024 12:53
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.

Cannot reference column from CTE in a set returning function
1 participant