maedhroz commented on code in PR #2433:
URL: https://github.com/apache/cassandra/pull/2433#discussion_r1267189704
##########
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:
Good catch! I'll fix on commit...
--
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]