@Override public SingleRestriction doMergeWith(SingleRestriction otherRestriction) { throw invalidRequest("%s cannot be restricted by a relation if it includes an IS NOT NULL", columnDef.name); }
/** * Required for SuperColumn compatibility, creates an adapter Relation that remaps all restrictions required for * SuperColumn tables. */ public Relation toSuperColumnAdapter() { throw invalidRequest("Unsupported operation (" + this + ") on super column family"); }
@Override public final void addRowFilterTo(RowFilter filter, SecondaryIndexManager indexManager, QueryOptions options) { throw invalidRequest("IN restrictions are not supported on indexed columns"); }
@Override public SingleRestriction doMergeWith(SingleRestriction otherRestriction) { throw invalidRequest("%s cannot be restricted by more than one relation if it includes an Equal", columnDef.name); }
@Override public final void addRowFilterTo(RowFilter filter, SecondaryIndexManager indexManager, QueryOptions options) { throw invalidRequest("Multi-column slice restrictions cannot be used for filtering."); }
@Override public SingleRestriction doMergeWith(SingleRestriction otherRestriction) { throw invalidRequest("%s cannot be restricted by more than one relation if it includes an Equal", columnDef.name); }
@Override public SingleRestriction doMergeWith(SingleRestriction otherRestriction) { throw invalidRequest("%s cannot be restricted by more than one relation if it includes a %s", columnDef.name, operator); }
@Override protected Restriction newContainsRestriction(CFMetaData cfm, VariableSpecifications boundNames, boolean isKey) throws InvalidRequestException { throw invalidRequest("%s cannot be used for multi-column relations", operator()); }
@Override protected Restriction newLikeRestriction(CFMetaData cfm, VariableSpecifications boundNames, Operator operator) throws InvalidRequestException { throw invalidRequest("%s cannot be used for multi-column relations", operator()); }
@Override protected Restriction newContainsRestriction(CFMetaData cfm, VariableSpecifications boundNames, boolean isKey) throws InvalidRequestException { throw invalidRequest("%s cannot be used for multi-column relations", operator()); }
@Override public SingleRestriction doMergeWith(SingleRestriction otherRestriction) { throw invalidRequest("%s cannot be restricted by more than one relation if it includes an Equal", getColumnsInCommons(otherRestriction)); }
@Override public SingleRestriction doMergeWith(SingleRestriction otherRestriction) { throw invalidRequest("%s cannot be restricted by a relation if it includes an IS NOT NULL clause", getColumnsInCommons(otherRestriction)); }
@Override protected PartitionKeyRestrictions doMergeWith(TokenRestriction otherRestriction) throws InvalidRequestException { throw invalidRequest("%s cannot be restricted by more than one relation if it includes an Equal", Joiner.on(", ").join(ColumnDefinition.toIdentifiers(columnDefs))); }
@Override protected Restriction newINRestriction(CFMetaData cfm, VariableSpecifications boundNames) throws InvalidRequestException { throw invalidRequest("%s cannot be used with the token function", operator()); }
@Override protected Restriction newIsNotRestriction(CFMetaData cfm, VariableSpecifications boundNames) throws InvalidRequestException { throw invalidRequest("%s cannot be used with the token function", operator()); }
private static Duration parseIso8601WeekFormat(boolean isNegative, String source) { Matcher matcher = ISO8601_WEEK_PATTERN.matcher(source); if (!matcher.matches()) throw invalidRequest("Unable to convert '%s' to a duration", source); return new Builder(isNegative).addWeeks(groupAsLong(matcher, 1)) .build(); }
@Override public void addRowFilterTo(RowFilter filter, SecondaryIndexManager indexManager, QueryOptions options) { Pair<Operator, ByteBuffer> operation = makeSpecific(value.bindAndGet(options)); // there must be a suitable INDEX for LIKE_XXX expressions RowFilter.SimpleExpression expression = filter.add(columnDef, operation.left, operation.right); indexManager.getBestIndexFor(expression) .orElseThrow(() -> invalidRequest("%s is only supported on properly indexed columns", expression)); }
/** * {@inheritDoc} */ @Override public MultiCBuilder appendTo(MultiCBuilder builder, QueryOptions options) { List<List<ByteBuffer>> splitInValues = splitValues(options); builder.addAllElementsToAll(splitInValues); if (builder.containsNull()) throw invalidRequest("Invalid null value in condition for columns: %s", ColumnDefinition.toIdentifiers(columnDefs)); return builder; }
@Override protected Restriction newLikeRestriction(CFMetaData cfm, VariableSpecifications boundNames, Operator operator) throws InvalidRequestException { if (mapKey != null) throw invalidRequest("%s can't be used with collections.", operator()); ColumnDefinition columnDef = entity.prepare(cfm); Term term = toTerm(toReceivers(columnDef), value, cfm.ksName, boundNames); return new SingleColumnRestriction.LikeRestriction(columnDef, operator, term); }
private void validateOperationOnDurations(AbstractType<?> type) { if (type.referencesDuration() && operator.isSlice()) { checkFalse(type.isCollection(), "Slice conditions are not supported on collections containing durations"); checkFalse(type.isTuple(), "Slice conditions are not supported on tuples containing durations"); checkFalse(type.isUDT(), "Slice conditions are not supported on UDTs containing durations"); throw invalidRequest("Slice conditions are not supported on durations", operator); } } }