adelapena commented on code in PR #2433:
URL: https://github.com/apache/cassandra/pull/2433#discussion_r1266540442


##########
src/java/org/apache/cassandra/cql3/statements/schema/CreateIndexStatement.java:
##########
@@ -316,6 +318,27 @@ public CreateIndexStatement prepare(ClientState state)
 
             if (indexName.hasKeyspace() && 
!keyspaceName.equals(indexName.getKeyspace()))
                 throw ire(KEYSPACE_DOES_NOT_MATCH_INDEX, keyspaceName, 
tableName);
+            
+            // Set the configured default 2i implementation if one isn't 
specified with USING:
+            if (attrs.customClass == null)
+            {
+                if (DatabaseDescriptor.getDefaultSecondaryIndexEnabled())
+                    attrs.customClass = 
DatabaseDescriptor.getDefaultSecondaryIndex();
+                else
+                    // However, operators may require an implementation be 
specified
+                    throw ire(MUST_SPECIFY_INDEX_IMPLEMENTATION);
+            }
+            
+            // If we explicitly specify the index type "cassandra", we can 
just clear the custom class, and the

Review Comment:
   ```suggestion
               // If we explicitly specify the index type "legacy_local_table", 
we can just clear the custom class, and the
   ```



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