Maxwell-Guo commented on code in PR #3721:
URL: https://github.com/apache/cassandra/pull/3721#discussion_r1871491854


##########
src/java/org/apache/cassandra/cql3/statements/schema/CreateTableStatement.java:
##########
@@ -140,14 +192,38 @@ public Keyspaces apply(ClusterMetadata metadata)
         if (!table.params.compression.isEnabled())
             Guardrails.uncompressedTablesEnabled.ensureEnabled(state);
 
-        return 
schema.withAddedOrUpdated(keyspace.withSwapped(keyspace.tables.with(table)));
+        return 
schema.withAddedOrUpdated(targetKeyspace.withSwapped(targetKeyspace.tables.with(table)));
     }
 
     @Override
     public void validate(ClientState state)
     {
         super.validate(state);
 
+        if (isCreateLike)

Review Comment:
   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



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to