Search in sources :

Example 1 with QueryableKeyExpression

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

the class QueryToKeyMatcherTest method testMatchWithQueryableExpression.

@Test
public void testMatchWithQueryableExpression() {
    final QueryableKeyExpression key = (QueryableKeyExpression) function("nada", concatenateFields("f1", "f2", "f3"));
    final QueryToKeyMatcher matcher = new QueryToKeyMatcher(Query.keyExpression(key).equalsValue("hello!"));
    Match match = matcher.matchesSatisfyingQuery(key);
    assertEquals(MatchType.EQUALITY, match.getType());
    assertEquals(Key.Evaluated.scalar("hello!"), match.getEquality());
}
Also used : QueryableKeyExpression(com.apple.foundationdb.record.metadata.expressions.QueryableKeyExpression) Match(com.apple.foundationdb.record.query.QueryToKeyMatcher.Match) Test(org.junit.jupiter.api.Test)

Aggregations

QueryableKeyExpression (com.apple.foundationdb.record.metadata.expressions.QueryableKeyExpression)1 Match (com.apple.foundationdb.record.query.QueryToKeyMatcher.Match)1 Test (org.junit.jupiter.api.Test)1