Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[YCQL] Support UDTs referring to other frozen UDTs #1630

Closed
frozenspider opened this issue Jun 26, 2019 · 2 comments
Closed

[YCQL] Support UDTs referring to other frozen UDTs #1630

frozenspider opened this issue Jun 26, 2019 · 2 comments
Labels
kind/enhancement This is an enhancement of an existing feature

Comments

@frozenspider
Copy link
Contributor

Cassandra CQL allows user-defined types to refer to other user-defined types (only frozen though), YCQL should allow the same thing.

CQL:

cqlsh> CREATE TYPE k.t2(i int, t k.t1);
InvalidRequest: Error from server: code=2200 [Invalid query] message="A user type cannot contain non-frozen UDTs"

cqlsh> CREATE TYPE k.t2(i int, t frozen<k.t1>);
# Works fine

YCQL:

cqlsh> CREATE TYPE k.t2(i int, t k.t1);
SyntaxException: Feature Not Supported. UDT field types cannot refer to other user-defined types
CREATE TYPE k.t2(i int, t k.t1);
                        ^
 (error -14)

cqlsh> CREATE TYPE k.t2(i int, t frozen<k.t1>);
SyntaxException: Feature Not Supported. UDT field types cannot refer to other user-defined types
CREATE TYPE k.t2(i int, t frozen<k.t1>);
                        ^
 (error -14)
@frozenspider frozenspider added the kind/enhancement This is an enhancement of an existing feature label Jun 26, 2019
@robinbraemer
Copy link

I want this feature get supported.

@m-iancu m-iancu added this to YQL-beta Dec 7, 2021
@m-iancu
Copy link
Contributor

m-iancu commented Mar 14, 2022

This is now allowed as long as the internal UDT is frozen (same as in vanilla Cassandra above).

ycqlsh> create keyspace k;
ycqlsh> use k;
ycqlsh:k> create type t1(a int);
ycqlsh:k> create type t2(i int, j t1);
SyntaxException: Feature Not Supported. A user-defined type cannot contain non-frozen UDTs
create type t2(i int, j t1);
                      ^
 (ql error -14)
ycqlsh:k> create type t2(i int, j frozen<t1>);
ycqlsh:k>

@m-iancu m-iancu closed this as completed Mar 14, 2022
@m-iancu m-iancu moved this to Done in YQL-beta Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement This is an enhancement of an existing feature
Projects
Status: Done
Development

No branches or pull requests

3 participants