smiklosovic commented on code in PR #3831:
URL: https://github.com/apache/cassandra/pull/3831#discussion_r1939203114
##########
src/java/org/apache/cassandra/cql3/statements/schema/CopyTableStatement.java:
##########
@@ -229,12 +234,37 @@ public void validate(ClientState state)
validateDefaultTimeToLive(attrs.asNewTableParams());
}
+ private void cloneIndexesIfNeeded(TableMetadata.Builder builder,
TableMetadata sourceTableMeta, KeyspaceMetadata targetKeyspaceMeta)
+ {
+ if (createLikeOption == CreateLikeOption.INDEX)
+ {
+ Indexes.Builder idxBuilder = Indexes.builder();
+ for (IndexMetadata indexMetadata : sourceTableMeta.indexes)
+ {
+ if (indexMetadata.kind == IndexMetadata.Kind.CUSTOM)
+ throw ire("CUSTOM INDEX is not supported.");
+
+ if (targetKeyspaceMeta.hasIndex(indexMetadata.name))
+ {
+ throw ire("Target keyspace already has an index with the
name : " + indexMetadata.name);
Review Comment:
`Target keyspace ks.tb has already an index with the name ...`
Please add there also keyspace and table
--
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]