Maxwell-Guo commented on code in PR #2865:
URL: https://github.com/apache/cassandra/pull/2865#discussion_r1384326907
##########
src/java/org/apache/cassandra/index/sai/plan/Operation.java:
##########
@@ -75,6 +75,7 @@ protected static ListMultimap<ColumnMetadata, Expression>
buildIndexExpressions(
for (final RowFilter.Expression e : expressions)
{
IndexContext indexContext = controller.getContext(e);
+
Review Comment:
remove this line
##########
test/unit/org/apache/cassandra/index/sai/cql/UnhandledExpressionsTest.java:
##########
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cassandra.index.sai.cql;
+
+import org.junit.Test;
+
+import org.apache.cassandra.exceptions.InvalidRequestException;
+import org.apache.cassandra.index.sai.SAITester;
+
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+
+public class UnhandledExpressionsTest extends SAITester
+{
+ @Test
+ public void unhandledOperatorsOnIndexedColumnAreHandledCorrectly()
Review Comment:
I think the function name is too long , what about change to some thing like
this: testUnHandledOperatorsOnSaiIndex, and we can give some detailed
description in the function body to show what the cases are(which you have
done).
##########
src/java/org/apache/cassandra/index/sai/plan/Expression.java:
##########
@@ -168,7 +168,7 @@ public Expression add(Operator op, ByteBuffer value)
break;
}
- assert operator != null;
+ assert operator != null || context.isNotIndexed() : "Cannot use '" +
op + "' operator with indexed " + context.getColumnName() + " column";
Review Comment:
what about also give the output with table name and sai index name ?
--
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]