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


##########
src/java/org/apache/cassandra/cql3/restrictions/ClusteringColumnRestrictions.java:
##########
@@ -92,61 +92,46 @@ public ClusteringColumnRestrictions mergeWith(Restriction 
restriction, @Nullable
         return new ClusteringColumnRestrictions(this.comparator, 
newRestrictionSet, allowFiltering);
     }
 
-    private boolean hasMultiColumnSlice()
-    {
-        for (SingleRestriction restriction : restrictions)
-        {
-            if (restriction.isMultiColumn() && restriction.isSlice())
-                return true;
-        }
-        return false;
-    }
-
     public NavigableSet<Clustering<?>> valuesAsClustering(QueryOptions 
options, ClientState state) throws InvalidRequestException
     {
-        MultiCBuilder builder = MultiCBuilder.create(comparator, hasIN());
+        MultiCBuilder builder = MultiCBuilder.create(comparator);
         for (SingleRestriction r : restrictions)
         {
             r.appendTo(builder, options);
 
             if (hasIN() && Guardrails.inSelectCartesianProduct.enabled(state))

Review Comment:
   `NOT IN` creates slice restrictions not `IN` resrictions. Slice restrictions 
on different columns cannot be combined with a cartesian multiplication. There 
is only one slice restriction allowed, and the slice restriction must be 
present on the last restricted clustering column. 
   
   I.e you cannot do this:
   `SELECT * FROM x WHERE clustering_col_1 NOT IN (...) AND clustering_column_2 
NOT IN (...)`
   
   `NOT IN` behaves a lot more like `<, > etc` in this regard. 
   
   However, now I noticed that `IN` can be combined with one `NOT IN`, so `NOT 
IN` could blow up the build size here because `NOT IN` can specify multiple 
values. I think it is an omission then and we need to include `NOT IN` in 
thecheck. 



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