Search in sources :

Example 6 with AndComponent

use of com.apple.foundationdb.record.query.expressions.AndComponent in project fdb-record-layer by FoundationDB.

the class RecordQueryPlanner method distributeAnd.

private List<QueryComponent> distributeAnd(List<QueryComponent> predicatesToDistribute, List<QueryComponent> children) {
    List<QueryComponent> distributed = new ArrayList<>();
    for (QueryComponent child : children) {
        List<QueryComponent> conjuncts = new ArrayList<>(2);
        conjuncts.addAll(predicatesToDistribute);
        if (child instanceof AndComponent) {
            conjuncts.addAll(((AndComponent) child).getChildren());
        } else {
            conjuncts.add(child);
        }
        child = AndComponent.from(conjuncts);
        distributed.add(child);
    }
    return distributed;
}
Also used : QueryComponent(com.apple.foundationdb.record.query.expressions.QueryComponent) AndComponent(com.apple.foundationdb.record.query.expressions.AndComponent) ArrayList(java.util.ArrayList)

Aggregations

AndComponent (com.apple.foundationdb.record.query.expressions.AndComponent)6 QueryComponent (com.apple.foundationdb.record.query.expressions.QueryComponent)5 ArrayList (java.util.ArrayList)3 Nullable (javax.annotation.Nullable)3 EmptyKeyExpression (com.apple.foundationdb.record.metadata.expressions.EmptyKeyExpression)2 GroupingKeyExpression (com.apple.foundationdb.record.metadata.expressions.GroupingKeyExpression)2 KeyExpression (com.apple.foundationdb.record.metadata.expressions.KeyExpression)2 Nonnull (javax.annotation.Nonnull)2 API (com.apple.foundationdb.annotation.API)1 FieldKeyExpression (com.apple.foundationdb.record.metadata.expressions.FieldKeyExpression)1 NestingKeyExpression (com.apple.foundationdb.record.metadata.expressions.NestingKeyExpression)1 RecordTypeKeyExpression (com.apple.foundationdb.record.metadata.expressions.RecordTypeKeyExpression)1 ThenKeyExpression (com.apple.foundationdb.record.metadata.expressions.ThenKeyExpression)1 VersionKeyExpression (com.apple.foundationdb.record.metadata.expressions.VersionKeyExpression)1 IndexScanComparisons (com.apple.foundationdb.record.provider.foundationdb.IndexScanComparisons)1 TimeWindowScanComparisons (com.apple.foundationdb.record.provider.foundationdb.leaderboard.TimeWindowScanComparisons)1 EnumeratingIterable (com.apple.foundationdb.record.query.combinatorics.EnumeratingIterable)1 TopologicalSort (com.apple.foundationdb.record.query.combinatorics.TopologicalSort)1 BaseField (com.apple.foundationdb.record.query.expressions.BaseField)1 Comparisons (com.apple.foundationdb.record.query.expressions.Comparisons)1