You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2021/08/17 21:11:12 UTC

[GitHub] [cassandra] smiklosovic commented on a change in pull request #1141: CASSANDRA-15135 - validate sasi analyzer

smiklosovic commented on a change in pull request #1141:
URL: https://github.com/apache/cassandra/pull/1141#discussion_r690725961



##########
File path: src/java/org/apache/cassandra/index/sasi/analyzer/DelimiterAnalyzer.java
##########
@@ -56,14 +57,16 @@ public ByteBuffer next()
         return iter.next();
     }
 
+    public void validate(Map<String, String> options, AbstractType validator) throws ConfigurationException
+    {
+        if (!VALID_ANALYZABLE_TYPES.containsKey(validator))
+            throw new ConfigurationException(String.format("Only text types supported, got %s", validator));

Review comment:
       @adelapena 
   I do not have a problem with the approach you are describing at the end of your response but please look closely here:
   
   ````
                   if (!analyzer.isCompatibleWith(cd.type))
                       throw new ConfigurationException(String.format("%s does not support type %s",
                                                                      analyzerClass.getSimpleName(),
                                                                      cd.type.asCQL3Type()));
                   analyzer.validate(indexOptions, cd.cellValueType());
   ````
   
   `cd.type` is not the same thing as `cd.cellValueType()` (go into cellValueType() and read the docs).
   
   isCompatibleWith excepts 'different" AbstractType than validate method would accept, if I understand that correctly.




-- 
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-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org