smiklosovic commented on code in PR #3831:
URL: https://github.com/apache/cassandra/pull/3831#discussion_r1948979057


##########
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:
   I do not think this is necessary. All we need to check is if that index is 
`CUSTOM`. 



-- 
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

Reply via email to