Search in sources :

Example 1 with KeyExpressionWithValue

use of com.apple.foundationdb.record.metadata.expressions.KeyExpressionWithValue in project fdb-record-layer by FoundationDB.

the class ValueIndexLikeExpansionVisitor method visitExpression.

@Nonnull
@Override
public GraphExpansion visitExpression(@Nonnull final KeyExpressionWithValue keyExpressionWithValue) {
    final VisitorState state = getCurrentState();
    final Value value = state.registerValue(keyExpressionWithValue.toValue(state.getBaseAlias(), state.getFieldNamePrefix()));
    if (state.isKey()) {
        final Placeholder predicate = value.asPlaceholder(newParameterAlias());
        return GraphExpansion.ofPlaceholder(value, predicate);
    }
    return GraphExpansion.ofResultValue(value);
}
Also used : Placeholder(com.apple.foundationdb.record.query.predicates.ValueComparisonRangePredicate.Placeholder) VisitorState(com.apple.foundationdb.record.query.plan.temp.ValueIndexLikeExpansionVisitor.VisitorState) QuantifiedObjectValue(com.apple.foundationdb.record.query.predicates.QuantifiedObjectValue) Value(com.apple.foundationdb.record.query.predicates.Value) EmptyValue(com.apple.foundationdb.record.query.predicates.EmptyValue) KeyExpressionWithValue(com.apple.foundationdb.record.metadata.expressions.KeyExpressionWithValue) FieldValue(com.apple.foundationdb.record.query.predicates.FieldValue) QuantifiedColumnValue(com.apple.foundationdb.record.query.predicates.QuantifiedColumnValue) Nonnull(javax.annotation.Nonnull)

Aggregations

KeyExpressionWithValue (com.apple.foundationdb.record.metadata.expressions.KeyExpressionWithValue)1 VisitorState (com.apple.foundationdb.record.query.plan.temp.ValueIndexLikeExpansionVisitor.VisitorState)1 EmptyValue (com.apple.foundationdb.record.query.predicates.EmptyValue)1 FieldValue (com.apple.foundationdb.record.query.predicates.FieldValue)1 QuantifiedColumnValue (com.apple.foundationdb.record.query.predicates.QuantifiedColumnValue)1 QuantifiedObjectValue (com.apple.foundationdb.record.query.predicates.QuantifiedObjectValue)1 Value (com.apple.foundationdb.record.query.predicates.Value)1 Placeholder (com.apple.foundationdb.record.query.predicates.ValueComparisonRangePredicate.Placeholder)1 Nonnull (javax.annotation.Nonnull)1