-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
CASSANDRA-19964 second approach - CREATE TABLE LIKE for copying Basic Table definition using create table parser #3721
Conversation
Hello, can i take up this issue? |
@@ -208,6 +208,11 @@ public ColumnMetadata(String ksName, | |||
this.mask = mask; | |||
} | |||
|
|||
protected ColumnMetadata cloneWithoutTableName(String keyspace, String table) | |||
{ | |||
return new ColumnMetadata(keyspace, table, name, type, position, kind, mask); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not a good idea, we are not copying it "deep enough".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, you are right.
feel free to left your review comments |
} | ||
|
||
@Override | ||
public void validate(ClientState state) | ||
{ | ||
super.validate(state); | ||
|
||
if (isCreateLike) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be all added to your new PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copytablestatement only deal with create table like CQL, so we may do not need this .
for cql like create table if not exist ta like tb
, there will be a SyntaxException. I have a test for this in CreateLikeCqlParseTest
f301539
to
a5448b0
Compare
a5448b0
to
e4d8031
Compare
This is for CASSANDRA-19664:
1、we can copy table under the same keyspace of under different keysapces.
2、only support basic table schema : primary key(partition key and clustering key), regular columns , static columns, column masking, table params(compaction, compression and so on).