Maxwell-Guo commented on code in PR #3831: URL: https://github.com/apache/cassandra/pull/3831#discussion_r1937529013
########## pylib/cqlshlib/cql3handling.py: ########## @@ -380,6 +380,11 @@ def dequote_value(cqlword): ( ender="," [propmapkey]=<term> ":" [propmapval]=<term> )* ender="}" ; +<propertyOrOption> ::= <property> Review Comment: we may only implement INDEX OPTION now, so ~~~ there will only be one copyOption now. ########## src/java/org/apache/cassandra/cql3/statements/schema/CopyTableStatement.java: ########## @@ -229,12 +238,56 @@ public void validate(ClientState state) validateDefaultTimeToLive(attrs.asNewTableParams()); } + private void maybeCopyIndexes(TableMetadata.Builder builder, TableMetadata sourceTableMeta, KeyspaceMetadata targetKeyspaceMeta) + { + if (createLikeOption != CreateLikeOption.INDEXES || sourceTableMeta.indexes.isEmpty()) + return; + + Set<String> customIndexes = Sets.newTreeSet(); + Set<String> alreadyExistingIndexes = Sets.newTreeSet(); + List<IndexMetadata> indexesToCopy = new ArrayList<>(); + for (IndexMetadata indexMetadata : sourceTableMeta.indexes) + { + // only sai and legacy secondary index is supported + if (indexMetadata.kind == IndexMetadata.Kind.CUSTOM && + indexMetadata.getIndexClassName() != StorageAttachedIndex.class.getCanonicalName()) Review Comment: For this test : [sai](https://github.com/Maxwell-Guo/cassandra/blob/CASSANDRA-19965/test/unit/org/apache/cassandra/schema/createlike/CreateLikeTest.java#L598) The index KIND seems to be CUSTOM with option of class_name : sai , So i just add the filter `indexMetadata.getIndexClassName() != StorageAttachedIndex.class.getCanonicalName()` to skip sai index. -- 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: pr-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For additional commands, e-mail: pr-h...@cassandra.apache.org