Accept ROW(...) as a SQL-standard alias for Tuple(...)#106265
Open
shreyasganesh0 wants to merge 1 commit into
Open
Accept ROW(...) as a SQL-standard alias for Tuple(...)#106265shreyasganesh0 wants to merge 1 commit into
shreyasganesh0 wants to merge 1 commit into
Conversation
Register ROW as a case-insensitive type-family alias for Tuple so that
standard-SQL / PostgreSQL spellings such as
CAST((1, 'a') AS ROW(x INTEGER, y VARCHAR(10)))
CREATE TABLE t (r ROW(id INTEGER, name VARCHAR(20))) ENGINE = Memory
are accepted, mirroring the existing INTEGER->Int32 / NUMERIC->Decimal
aliases. Named-element access on the resulting tuple already works.
Closes ClickHouse#105954.
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.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Accept
ROW(name type, ...)as a SQL-standard alias forTuple(name type, ...)in type expressions (CAST, column DDL), for PostgreSQL compatibility.Documentation entry for user-facing changes
Closes #105954.
ROW(...)is now accepted anywhere a type is expected, as a case-insensitive alias forTuple(...):Implemented as a single
registerAlias("ROW", "Tuple", Case::Insensitive)inregisterDataTypeTuple, mirroring the existingNUMERIC→Decimal/INTEGER→Int32aliases. Named-element access on the resulting tuple already works. Covered by a new stateless test04299_row_tuple_type_alias.