Skip to content

opt: resolve TupleStars in UDFs and views#104929

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
mgartner:104927-resolve-tuple-star
Jun 15, 2023
Merged

opt: resolve TupleStars in UDFs and views#104929
craig[bot] merged 1 commit intocockroachdb:masterfrom
mgartner:104927-resolve-tuple-star

Conversation

@mgartner
Copy link
Copy Markdown
Contributor

@mgartner mgartner commented Jun 14, 2023

Star expressions have been allowed in UDFs since #95710 and in views
since #97515. This commit lifts a restriction that prevented table
references from being resolved as TupleStars in SELECT lists inside UDFs
and views. For example, an expression like SELECT tbl FROM tbl is now
allowed inside views and UDFs.

Fixes #104927
Fixes #97602

Release note (sql change): Table names are now allowed in SELECT lists
inside view and UDF definitions.

@mgartner mgartner requested a review from rharding6373 June 14, 2023 22:36
@mgartner mgartner requested a review from a team as a code owner June 14, 2023 22:36
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Star expressions have been allowed in UDFs since cockroachdb#95710 and in views
since cockroachdb#97515. This commit lifts a restriction that prevented table
references from being resolved as TupleStars in SELECT lists inside UDFs
and views. For example, an expression like `SELECT tbl FROM tbl` is now
allowed inside views and UDFs.

Fixes cockroachdb#104927

Release note (sql change): Table names are now allowed in SELECT lists
inside view and UDF definitions.
@mgartner mgartner force-pushed the 104927-resolve-tuple-star branch from ffeef8d to afa92a0 Compare June 15, 2023 12:28
Copy link
Copy Markdown
Collaborator

@rharding6373 rharding6373 left a comment

Choose a reason for hiding this comment

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

:lgtm: Nice work! Does this also resolve this issue Drew and I found during a pair programming session awhile back? #97602

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

@mgartner
Copy link
Copy Markdown
Contributor Author

Does this also resolve this issue Drew and I found during a pair programming session awhile back?

Yes! Thanks for pointing it out.

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jun 15, 2023

Build succeeded:

@craig craig bot merged commit ba010f9 into cockroachdb:master Jun 15, 2023
@mgartner mgartner deleted the 104927-resolve-tuple-star branch June 15, 2023 15:46
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.

sql: column does not exists error for statement with alias inside UDF sql: tuple expansion of table in udfs fails with "column...does not exist"

3 participants