Make the COPARTITION keyword reserved #15734
Closed
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.
COPARTITION is a keyword specific to table functions. It is neither reserved nor non-reserved according to SQL spec of 2016. Before this change, COPARTITION was a non-reserved word, leading to a failure in a case like:
SELECT * FROM TABLE(system.test_inputs_function(
input_1 => TABLE(VALUES 1, 2, 3),
input_2 => TABLE(VALUES 1, 1, null, null, 2, 2) t2(x2) PARTITION BY x2,
input_3 => TABLE(VALUES null, 2, 2, 2, 3) t3(x3) PARTITION BY x3,
input_4 => TABLE(VALUES 4, 5)
COPARTITION (t2, t3)))
because the COPARTITION clause was parsed as a table alias.
Release notes
(X) This is not user-visible or docs only and no release notes are required.
Table arguments are not yet supported. But maybe we should document the reserved word?
( ) Release notes are required, please propose a release note for me.
( ) Release notes are required, with the following suggested text: