maedhroz commented on code in PR #3095:
URL: https://github.com/apache/cassandra/pull/3095#discussion_r1588559722
##########
src/java/org/apache/cassandra/cql3/restrictions/ClusteringColumnRestrictions.java:
##########
@@ -92,24 +92,16 @@ 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 = new MultiCBuilder(comparator);
for (SingleRestriction r : restrictions)
{
- r.appendTo(builder, options);
+ List<ClusteringElements> values = r.values(options);
+ builder.extend(values);
- if (hasIN() && Guardrails.inSelectCartesianProduct.enabled(state))
+ // If values is greater than 1 we know that the restriction is an
IN
+ if (values.size() > 1 &&
Guardrails.inSelectCartesianProduct.enabled(state))
Review Comment:
Would `hasIN()` be incorrect though? Seems more explicit/future-proof, but
there's probably something I'm missing...
--
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]