pkolaczk commented on code in PR #2556:
URL: https://github.com/apache/cassandra/pull/2556#discussion_r1384691052


##########
src/java/org/apache/cassandra/cql3/restrictions/SingleColumnRestriction.java:
##########
@@ -403,49 +381,80 @@ public void addToRowFilter(RowFilter filter, 
IndexRegistry indexRegistry, QueryO
             for (Bound b : Bound.values())
                 if (hasBound(b))
                     filter.add(columnDef, slice.getIndexOperator(b), 
slice.bound(b).bindAndGet(options));
+
+            for (MarkerOrTerms markerOrTerms : skippedValues)
+            {
+                for (ByteBuffer value : markerOrTerms.bindAndGet(options, 
columnDef.name))
+                   filter.add(columnDef, Operator.NEQ, value);
+            }
         }
 
         @Override
         protected boolean isSupportedBy(Index index)
         {
-            return slice.isSupportedBy(columnDef, index);
+            boolean supportsSlice = slice.isSupportedBy(columnDef, index);
+            boolean supportsNeq = index.supportsExpression(columnDef, 
Operator.NEQ);
+            return  supportsSlice || !skippedValues.isEmpty() && supportsNeq;

Review Comment:
   I don't agree on this one. This is just coincidental duplication - 
accidentally both single and multi restrictions work the same way here, but 
there is no fundamental reason they have to. The amount of duplication is also 
very tiny. And introducing an unrelated parameter to `TermSlice` is mixing 
responsibilities which is IMHO worse.
   
   I thought that maybe we could move the skipped values to the `TermSlice` 
itself. Then it would make more sense to have `TermSlice` handle the 
`isSupportedBy` logic as it would have all the information it needs. WDYT?



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