Search in sources :

Example 36 with RecordQueryPlan

use of com.apple.foundationdb.record.query.plan.plans.RecordQueryPlan in project fdb-record-layer by FoundationDB.

the class FDBMultiFieldIndexSelectionTest method testComplexQuery4.

/**
 * Verify that a complex query with an appropriate multi-field index uses the index, even when bounds are complex.
 */
@DualPlannerTest
void testComplexQuery4() throws Exception {
    RecordMetaDataHook hook = complexQuerySetupHook();
    complexQuerySetup(hook);
    RecordQuery query = RecordQuery.newBuilder().setRecordType("MySimpleRecord").setFilter(Query.and(Query.field("str_value_indexed").equalsValue("even"), Query.field("num_value_2").equalsValue(0), Query.field("num_value_3_indexed").greaterThanOrEquals(2))).setSort(field("num_value_3_indexed")).build();
    // Index(multi_index [[even, 0, 2],[even, 0]])
    RecordQueryPlan plan = planner.plan(query);
    assertThat(plan, indexScan(allOf(indexName("multi_index"), bounds(hasTupleString("[[even, 0, 2],[even, 0]]")))));
    assertEquals(1276767038, plan.planHash(PlanHashable.PlanHashKind.LEGACY));
    assertEquals(1295098356, plan.planHash(PlanHashable.PlanHashKind.FOR_CONTINUATION));
    assertEquals(-132587146, plan.planHash(PlanHashable.PlanHashKind.STRUCTURAL_WITHOUT_LITERALS));
    try (FDBRecordContext context = openContext()) {
        openSimpleRecordStore(context, hook);
        int i = 0;
        try (RecordCursorIterator<FDBQueriedRecord<Message>> cursor = recordStore.executeQuery(plan).asIterator()) {
            while (cursor.hasNext()) {
                FDBQueriedRecord<Message> rec = cursor.next();
                TestRecords1Proto.MySimpleRecord.Builder myrec = TestRecords1Proto.MySimpleRecord.newBuilder();
                myrec.mergeFrom(Objects.requireNonNull(rec).getRecord());
                assertEquals("even", myrec.getStrValueIndexed());
                assertEquals(0, (myrec.getNumValue2() % 3));
                assertTrue((myrec.getNumValue3Indexed() % 5) >= 2);
                i++;
            }
        }
        assertEquals(9, i);
        TestHelpers.assertDiscardedNone(context);
    }
}
Also used : RecordQueryPlan(com.apple.foundationdb.record.query.plan.plans.RecordQueryPlan) FDBQueriedRecord(com.apple.foundationdb.record.provider.foundationdb.FDBQueriedRecord) Message(com.google.protobuf.Message) FDBRecordContext(com.apple.foundationdb.record.provider.foundationdb.FDBRecordContext) RecordQuery(com.apple.foundationdb.record.query.RecordQuery)

Example 37 with RecordQueryPlan

use of com.apple.foundationdb.record.query.plan.plans.RecordQueryPlan in project fdb-record-layer by FoundationDB.

the class FDBMultiFieldIndexSelectionTest method testPrefixScalar.

/**
 * Verify that a two field index can be used for queries on both the first field alone and both fields.
 */
@DualPlannerTest
void testPrefixScalar() {
    RecordMetaDataHook hook = metaData -> metaData.addIndex("MySimpleRecord", "prefix_scalar", concat(field("num_value_2"), field("num_value_3_indexed")));
    try (FDBRecordContext context = openContext()) {
        openSimpleRecordStore(context, hook);
        TestRecords1Proto.MySimpleRecord.Builder recordBuilder = TestRecords1Proto.MySimpleRecord.newBuilder();
        recordBuilder.setRecNo(1).setNumValue2(1).setNumValue3Indexed(1);
        recordStore.saveRecord(recordBuilder.build());
        recordBuilder.setRecNo(2).setNumValue2(2).setNumValue3Indexed(2);
        recordStore.saveRecord(recordBuilder.build());
        recordBuilder.setRecNo(3).setNumValue2(1).clearNumValue3Indexed();
        recordStore.saveRecord(recordBuilder.build());
        commit(context);
    }
    RecordQuery query1 = RecordQuery.newBuilder().setRecordType("MySimpleRecord").setFilter(Query.field("num_value_2").equalsValue(1)).build();
    // Index(prefix_scalar [[1],[1]])
    RecordQueryPlan plan1 = planner.plan(query1);
    assertThat(plan1, indexScan(allOf(indexName("prefix_scalar"), bounds(hasTupleString("[[1],[1]]")))));
    assertEquals(339959201, plan1.planHash(PlanHashable.PlanHashKind.LEGACY));
    assertEquals(1160014595, plan1.planHash(PlanHashable.PlanHashKind.FOR_CONTINUATION));
    assertEquals(1504375084, plan1.planHash(PlanHashable.PlanHashKind.STRUCTURAL_WITHOUT_LITERALS));
    RecordQuery query2 = RecordQuery.newBuilder().setRecordType("MySimpleRecord").setFilter(Query.and(Query.field("num_value_2").equalsValue(1), Query.field("num_value_3_indexed").equalsValue(1))).build();
    RecordQueryPlan plan2 = planner.plan(query2);
    assertThat(plan2, indexScan(allOf(indexName("prefix_scalar"), bounds(hasTupleString("[[1, 1],[1, 1]]")))));
    assertEquals(-447322749, plan2.planHash(PlanHashable.PlanHashKind.LEGACY));
    assertEquals(-1253390298, plan2.planHash(PlanHashable.PlanHashKind.FOR_CONTINUATION));
    assertEquals(1176210758, plan2.planHash(PlanHashable.PlanHashKind.STRUCTURAL_WITHOUT_LITERALS));
    try (FDBRecordContext context = openContext()) {
        openSimpleRecordStore(context, hook);
        List<Long> recnos = recordStore.executeQuery(plan1).map(r -> TestRecords1Proto.MySimpleRecord.newBuilder().mergeFrom(r.getRecord()).getRecNo()).asList().join();
        assertEquals(Arrays.asList(3L, 1L), recnos);
        TestHelpers.assertDiscardedNone(context);
        clearStoreCounter(context);
        recnos = recordStore.executeQuery(plan2).map(r -> TestRecords1Proto.MySimpleRecord.newBuilder().mergeFrom(r.getRecord()).getRecNo()).asList().join();
        assertEquals(ImmutableList.of(1L), recnos);
        TestHelpers.assertDiscardedNone(context);
    }
}
Also used : Arrays(java.util.Arrays) PlanMatchers.indexScan(com.apple.foundationdb.record.query.plan.match.PlanMatchers.indexScan) FDBRecordContext(com.apple.foundationdb.record.provider.foundationdb.FDBRecordContext) RecordQuery(com.apple.foundationdb.record.query.RecordQuery) RecordQueryPlan(com.apple.foundationdb.record.query.plan.plans.RecordQueryPlan) PlanMatchers.bounds(com.apple.foundationdb.record.query.plan.match.PlanMatchers.bounds) PlanHashable(com.apple.foundationdb.record.PlanHashable) TestHelpers(com.apple.foundationdb.record.TestHelpers) ImmutableList(com.google.common.collect.ImmutableList) RecordCursorIterator(com.apple.foundationdb.record.RecordCursorIterator) Expressions.concat(com.apple.foundationdb.record.metadata.Key.Expressions.concat) Tag(org.junit.jupiter.api.Tag) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) Expressions.field(com.apple.foundationdb.record.metadata.Key.Expressions.field) Query(com.apple.foundationdb.record.query.expressions.Query) TestRecords1Proto(com.apple.foundationdb.record.TestRecords1Proto) Tags(com.apple.test.Tags) Matchers.allOf(org.hamcrest.Matchers.allOf) Objects(java.util.Objects) PlanMatchers.hasTupleString(com.apple.foundationdb.record.query.plan.match.PlanMatchers.hasTupleString) List(java.util.List) PlanMatchers.indexName(com.apple.foundationdb.record.query.plan.match.PlanMatchers.indexName) FDBQueriedRecord(com.apple.foundationdb.record.provider.foundationdb.FDBQueriedRecord) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) Message(com.google.protobuf.Message) RecordQueryPlan(com.apple.foundationdb.record.query.plan.plans.RecordQueryPlan) FDBRecordContext(com.apple.foundationdb.record.provider.foundationdb.FDBRecordContext) RecordQuery(com.apple.foundationdb.record.query.RecordQuery)

Example 38 with RecordQueryPlan

use of com.apple.foundationdb.record.query.plan.plans.RecordQueryPlan in project fdb-record-layer by FoundationDB.

the class FDBNestedFieldQueryTest method hierarchical.

/**
 * Verify that simple queries on nested fields can use bounds on a record scan.
 */
@DualPlannerTest
public void hierarchical() throws Exception {
    try (FDBRecordContext context = openContext()) {
        openHierarchicalRecordStore(context);
        TestRecords3Proto.MyHierarchicalRecord.Builder recBuilder = TestRecords3Proto.MyHierarchicalRecord.newBuilder();
        recBuilder.setChildName("photos");
        recBuilder.setNumValueIndexed(1);
        recordStore.saveRecord(recBuilder.build());
        recBuilder.setChildName("music");
        recBuilder.setNumValueIndexed(2);
        recordStore.saveRecord(recBuilder.build());
        recBuilder.setParentPath("photos");
        recBuilder.setChildName("vacations");
        recBuilder.setNumValueIndexed(11);
        recordStore.saveRecord(recBuilder.build());
        recBuilder.setChildName("pets");
        recBuilder.setNumValueIndexed(12);
        recordStore.saveRecord(recBuilder.build());
        recBuilder.setParentPath("photos/vacations");
        recBuilder.setChildName("paris");
        recBuilder.setNumValueIndexed(111);
        recordStore.saveRecord(recBuilder.build());
        recBuilder.setChildName("london");
        recBuilder.setNumValueIndexed(112);
        recordStore.saveRecord(recBuilder.build());
        recBuilder.setParentPath("photos/vacations/paris");
        recBuilder.setChildName("seine");
        recBuilder.setNumValueIndexed(1111);
        recordStore.saveRecord(recBuilder.build());
        commit(context);
    }
    try (FDBRecordContext context = openContext()) {
        openHierarchicalRecordStore(context);
        FDBStoredRecord<Message> rec = recordStore.loadRecord(Tuple.from(null, "photos"));
        assertNotNull(rec);
        TestRecords3Proto.MyHierarchicalRecord.Builder myrec = TestRecords3Proto.MyHierarchicalRecord.newBuilder();
        myrec.mergeFrom(rec.getRecord());
        assertEquals(1, myrec.getNumValueIndexed());
    }
    RecordQuery query = RecordQuery.newBuilder().setRecordType("MyHierarchicalRecord").setFilter(Query.field("parent_path").equalsValue("photos")).build();
    // Scan([[photos],[photos]])
    RecordQueryPlan plan = planner.plan(query);
    assertThat(plan, scan(bounds(hasTupleString("[[photos],[photos]]"))));
    assertEquals(1063779424, plan.planHash(PlanHashable.PlanHashKind.LEGACY));
    assertEquals(-623055281, plan.planHash(PlanHashable.PlanHashKind.FOR_CONTINUATION));
    assertEquals(568511736, plan.planHash(PlanHashable.PlanHashKind.STRUCTURAL_WITHOUT_LITERALS));
    assertEquals(Arrays.asList(12, 11), fetchResultValues(plan, TestRecords3Proto.MyHierarchicalRecord.NUM_VALUE_INDEXED_FIELD_NUMBER, this::openHierarchicalRecordStore, TestHelpers::assertDiscardedNone));
    query = RecordQuery.newBuilder().setRecordType("MyHierarchicalRecord").setFilter(Query.field("parent_path").startsWith("photos")).build();
    // Scan({[photos],[photos]})
    plan = planner.plan(query);
    assertThat(plan, scan(bounds(hasTupleString("{[photos],[photos]}"))));
    assertEquals(224213141, plan.planHash(PlanHashable.PlanHashKind.LEGACY));
    assertEquals(1663787616, plan.planHash(PlanHashable.PlanHashKind.FOR_CONTINUATION));
    assertEquals(1347957217, plan.planHash(PlanHashable.PlanHashKind.STRUCTURAL_WITHOUT_LITERALS));
    assertEquals(Arrays.asList(12, 11, 112, 111, 1111), fetchResultValues(plan, TestRecords3Proto.MyHierarchicalRecord.NUM_VALUE_INDEXED_FIELD_NUMBER, this::openHierarchicalRecordStore, TestHelpers::assertDiscardedNone));
}
Also used : RecordQueryPlan(com.apple.foundationdb.record.query.plan.plans.RecordQueryPlan) Message(com.google.protobuf.Message) FDBRecordContext(com.apple.foundationdb.record.provider.foundationdb.FDBRecordContext) RecordQuery(com.apple.foundationdb.record.query.RecordQuery)

Example 39 with RecordQueryPlan

use of com.apple.foundationdb.record.query.plan.plans.RecordQueryPlan in project fdb-record-layer by FoundationDB.

the class FDBNestedFieldQueryTest method nestedRankMap.

/**
 * Verify that a rank index on a map-like repeated nested message can be scanned for rank comparisons.
 */
@Test
public void nestedRankMap() throws Exception {
    final GroupingKeyExpression rankGroup = new GroupingKeyExpression(concat(field("other_id"), field("map").nest(field("entry", KeyExpression.FanType.FanOut).nest(concatenateFields("key", "value")))), 1);
    final RecordMetaDataBuilder metaDataBuilder = RecordMetaData.newBuilder().setRecords(TestRecordsNestedMapProto.getDescriptor());
    metaDataBuilder.addIndex("OuterRecord", new Index("rank_value_by_key", rankGroup, IndexTypes.RANK));
    // TODO: This is not a very obvious way to specify this. But we don't have correlation names.
    final QueryComponent keyCondition = Query.field("map").matches(Query.field("entry").oneOfThem().matches(Query.field("key").equalsValue("alpha")));
    final QueryRecordFunction<Long> rank = Query.rank(rankGroup).withAdditionalCondition(keyCondition);
    try (FDBRecordContext context = openContext()) {
        createOrOpenRecordStore(context, metaDataBuilder.getRecordMetaData());
        TestRecordsNestedMapProto.OuterRecord.Builder builder = TestRecordsNestedMapProto.OuterRecord.newBuilder().setOtherId(1);
        TestRecordsNestedMapProto.MapRecord.Builder mapBuilder = builder.getMapBuilder();
        builder.setRecId(1);
        mapBuilder.addEntryBuilder().setKey("alpha").setValue("abc");
        mapBuilder.addEntryBuilder().setKey("beta").setValue("bcd");
        recordStore.saveRecord(builder.build());
        builder.setRecId(2);
        mapBuilder.clear();
        mapBuilder.addEntryBuilder().setKey("alpha").setValue("aaa");
        mapBuilder.addEntryBuilder().setKey("beta").setValue("bbb");
        recordStore.saveRecord(builder.build());
        commit(context);
    }
    RecordQuery query = RecordQuery.newBuilder().setRecordType("OuterRecord").setFilter(Query.and(Query.field("other_id").equalsValue(1L), Query.rank(rankGroup).lessThan(10L), keyCondition)).build();
    RecordQueryPlan plan = planner.plan(query);
    assertThat(plan, primaryKeyDistinct(indexScan(allOf(indexName("rank_value_by_key"), indexScanType(IndexScanType.BY_RANK), bounds(hasTupleString("([1, alpha, null],[1, alpha, 10])"))))));
    assertEquals(1307013946, plan.planHash(PlanHashable.PlanHashKind.LEGACY));
    assertEquals(-1725407749, plan.planHash(PlanHashable.PlanHashKind.FOR_CONTINUATION));
    assertEquals(825274646, plan.planHash(PlanHashable.PlanHashKind.STRUCTURAL_WITHOUT_LITERALS));
    try (FDBRecordContext context = openContext()) {
        createOrOpenRecordStore(context, metaDataBuilder.getRecordMetaData());
        try (RecordCursor<FDBQueriedRecord<Message>> cursor = recordStore.executeQuery(plan)) {
            RecordCursorResult<FDBQueriedRecord<Message>> result = cursor.getNext();
            assertTrue(result.hasNext());
            assertEquals(Tuple.from(2), result.get().getPrimaryKey());
            result = cursor.getNext();
            assertTrue(result.hasNext());
            assertEquals(Tuple.from(1), result.get().getPrimaryKey());
            assertEquals(1, rank.eval(recordStore, EvaluationContext.EMPTY, result.get().getStoredRecord()).get());
            result = cursor.getNext();
            assertFalse(result.hasNext());
        }
    }
}
Also used : RecordQueryPlan(com.apple.foundationdb.record.query.plan.plans.RecordQueryPlan) QueryComponent(com.apple.foundationdb.record.query.expressions.QueryComponent) GroupingKeyExpression(com.apple.foundationdb.record.metadata.expressions.GroupingKeyExpression) Index(com.apple.foundationdb.record.metadata.Index) FDBQueriedRecord(com.apple.foundationdb.record.provider.foundationdb.FDBQueriedRecord) RecordMetaDataBuilder(com.apple.foundationdb.record.RecordMetaDataBuilder) FDBRecordContext(com.apple.foundationdb.record.provider.foundationdb.FDBRecordContext) RecordQuery(com.apple.foundationdb.record.query.RecordQuery) Test(org.junit.jupiter.api.Test)

Example 40 with RecordQueryPlan

use of com.apple.foundationdb.record.query.plan.plans.RecordQueryPlan in project fdb-record-layer by FoundationDB.

the class FDBNestedFieldQueryTest method doublyNested.

/**
 * Verify that queries on doubly nested records with fanout on the inner field work properly.
 */
@DualPlannerTest
public void doublyNested() throws Exception {
    try (FDBRecordContext context = openContext()) {
        openDoublyNestedRecordStore(context);
        TestRecords5Proto.CalendarEvent.Builder eventBuilder = TestRecords5Proto.CalendarEvent.newBuilder();
        eventBuilder.setPath("ev1");
        TestRecords5Proto.CalendarEventIndex.Builder indexBuilder = eventBuilder.getEventIndexBuilder();
        TestRecords5Proto.Recurrence.Builder occurBuilder = indexBuilder.addRecurrenceBuilder();
        occurBuilder.setStart(2);
        occurBuilder.setEnd(2);
        occurBuilder = indexBuilder.addRecurrenceBuilder();
        occurBuilder.setStart(12);
        occurBuilder.setEnd(12);
        recordStore.saveRecord(eventBuilder.build());
        eventBuilder = TestRecords5Proto.CalendarEvent.newBuilder();
        eventBuilder.setPath("ev2");
        indexBuilder = eventBuilder.getEventIndexBuilder();
        occurBuilder = indexBuilder.addRecurrenceBuilder();
        occurBuilder.setStart(5);
        occurBuilder.setEnd(5);
        recordStore.saveRecord(eventBuilder.build());
        eventBuilder = TestRecords5Proto.CalendarEvent.newBuilder();
        eventBuilder.setPath("ev3");
        indexBuilder = eventBuilder.getEventIndexBuilder();
        occurBuilder = indexBuilder.addRecurrenceBuilder();
        occurBuilder.setStart(15);
        occurBuilder.setEnd(15);
        occurBuilder = indexBuilder.addRecurrenceBuilder();
        occurBuilder.setStart(25);
        occurBuilder.setEnd(25);
        recordStore.saveRecord(eventBuilder.build());
        commit(context);
    }
    // TODO this was originally:
    // QueryExpression.field("eventIndex").matches(
    // QueryExpression.field("recurrence").matches(
    // QueryExpression.field("start").greaterThan(10L))),
    // which should have failed validate
    RecordQuery query = RecordQuery.newBuilder().setRecordType("CalendarEvent").setFilter(Query.field("eventIndex").matches(Query.field("recurrence").oneOfThem().matches(Query.field("start").greaterThan(10L)))).build();
    // Index(event_start ([10],>) | UnorderedPrimaryKeyDistinct()
    RecordQueryPlan plan = planner.plan(query);
    if (planner instanceof RecordQueryPlanner) {
        assertThat(plan, primaryKeyDistinct(indexScan(allOf(indexName("event_start"), bounds(hasTupleString("([10],>"))))));
        assertEquals(667993366, plan.planHash(PlanHashable.PlanHashKind.LEGACY));
        assertEquals(-1217457303, plan.planHash(PlanHashable.PlanHashKind.FOR_CONTINUATION));
        assertEquals(-1297919931, plan.planHash(PlanHashable.PlanHashKind.STRUCTURAL_WITHOUT_LITERALS));
    } else {
        assertThat(plan, fetch(primaryKeyDistinct(coveringIndexScan(indexScan(allOf(indexName("event_start"), bounds(hasTupleString("([10],>"))))))));
        assertEquals(380986279, plan.planHash(PlanHashable.PlanHashKind.LEGACY));
        assertEquals(-721491332, plan.planHash(PlanHashable.PlanHashKind.FOR_CONTINUATION));
        assertEquals(-801953960, plan.planHash(PlanHashable.PlanHashKind.STRUCTURAL_WITHOUT_LITERALS));
    }
    assertEquals(Arrays.asList("ev1", "ev3"), fetchResultValues(plan, TestRecords5Proto.CalendarEvent.PATH_FIELD_NUMBER, this::openDoublyNestedRecordStore, context -> TestHelpers.assertDiscardedAtMost(1, context)));
}
Also used : RecordQueryPlan(com.apple.foundationdb.record.query.plan.plans.RecordQueryPlan) Arrays(java.util.Arrays) TestRecords3Proto(com.apple.foundationdb.record.TestRecords3Proto) FDBRecordContext(com.apple.foundationdb.record.provider.foundationdb.FDBRecordContext) PlanMatchers.bounds(com.apple.foundationdb.record.query.plan.match.PlanMatchers.bounds) RecordQueryPlanner(com.apple.foundationdb.record.query.plan.RecordQueryPlanner) IndexScanType(com.apple.foundationdb.record.IndexScanType) Tuple(com.apple.foundationdb.tuple.Tuple) RecordCursorResult(com.apple.foundationdb.record.RecordCursorResult) TestHelpers(com.apple.foundationdb.record.TestHelpers) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) Expressions.concatenateFields(com.apple.foundationdb.record.metadata.Key.Expressions.concatenateFields) Expressions.concat(com.apple.foundationdb.record.metadata.Key.Expressions.concat) GroupingKeyExpression(com.apple.foundationdb.record.metadata.expressions.GroupingKeyExpression) Tag(org.junit.jupiter.api.Tag) PlanMatchers.coveringIndexScan(com.apple.foundationdb.record.query.plan.match.PlanMatchers.coveringIndexScan) PlanMatchers.indexScanType(com.apple.foundationdb.record.query.plan.match.PlanMatchers.indexScanType) TestRecords4Proto(com.apple.foundationdb.record.TestRecords4Proto) Query(com.apple.foundationdb.record.query.expressions.Query) KeyExpression(com.apple.foundationdb.record.metadata.expressions.KeyExpression) Matchers.allOf(org.hamcrest.Matchers.allOf) Test(org.junit.jupiter.api.Test) PlanMatchers.hasTupleString(com.apple.foundationdb.record.query.plan.match.PlanMatchers.hasTupleString) PlanMatchers.indexName(com.apple.foundationdb.record.query.plan.match.PlanMatchers.indexName) EvaluationContext(com.apple.foundationdb.record.EvaluationContext) FDBQueriedRecord(com.apple.foundationdb.record.provider.foundationdb.FDBQueriedRecord) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) IndexTypes(com.apple.foundationdb.record.metadata.IndexTypes) TestRecordsWithHeaderProto(com.apple.foundationdb.record.TestRecordsWithHeaderProto) RecordMetaData(com.apple.foundationdb.record.RecordMetaData) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) PlanMatchers.fetch(com.apple.foundationdb.record.query.plan.match.PlanMatchers.fetch) QueryRecordFunction(com.apple.foundationdb.record.query.expressions.QueryRecordFunction) PlanMatchers.primaryKeyDistinct(com.apple.foundationdb.record.query.plan.match.PlanMatchers.primaryKeyDistinct) PlanMatchers.indexScan(com.apple.foundationdb.record.query.plan.match.PlanMatchers.indexScan) PlanMatchers.queryPredicateDescendant(com.apple.foundationdb.record.query.plan.match.PlanMatchers.queryPredicateDescendant) RecordQuery(com.apple.foundationdb.record.query.RecordQuery) RecordQueryPlan(com.apple.foundationdb.record.query.plan.plans.RecordQueryPlan) TestRecordsNestedMapProto(com.apple.foundationdb.record.TestRecordsNestedMapProto) PlanHashable(com.apple.foundationdb.record.PlanHashable) PlanMatchers.filter(com.apple.foundationdb.record.query.plan.match.PlanMatchers.filter) Key(com.apple.foundationdb.record.metadata.Key) PlanMatchers.scan(com.apple.foundationdb.record.query.plan.match.PlanMatchers.scan) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) Expressions.field(com.apple.foundationdb.record.metadata.Key.Expressions.field) FDBStoredRecord(com.apple.foundationdb.record.provider.foundationdb.FDBStoredRecord) RecordMetaDataBuilder(com.apple.foundationdb.record.RecordMetaDataBuilder) Tags(com.apple.test.Tags) PredicateMatchers(com.apple.foundationdb.record.query.predicates.match.PredicateMatchers) TestRecords5Proto(com.apple.foundationdb.record.TestRecords5Proto) Index(com.apple.foundationdb.record.metadata.Index) Message(com.google.protobuf.Message) RecordCursor(com.apple.foundationdb.record.RecordCursor) QueryComponent(com.apple.foundationdb.record.query.expressions.QueryComponent) Collections(java.util.Collections) FDBRecordContext(com.apple.foundationdb.record.provider.foundationdb.FDBRecordContext) RecordQueryPlanner(com.apple.foundationdb.record.query.plan.RecordQueryPlanner) RecordQuery(com.apple.foundationdb.record.query.RecordQuery)

Aggregations

RecordQueryPlan (com.apple.foundationdb.record.query.plan.plans.RecordQueryPlan)373 RecordQuery (com.apple.foundationdb.record.query.RecordQuery)265 FDBRecordContext (com.apple.foundationdb.record.provider.foundationdb.FDBRecordContext)245 Test (org.junit.jupiter.api.Test)228 FDBQueriedRecord (com.apple.foundationdb.record.provider.foundationdb.FDBQueriedRecord)174 Message (com.google.protobuf.Message)167 Query (com.apple.foundationdb.record.query.expressions.Query)123 Tags (com.apple.test.Tags)121 Tag (org.junit.jupiter.api.Tag)121 Index (com.apple.foundationdb.record.metadata.Index)119 RecordQueryPlanner (com.apple.foundationdb.record.query.plan.RecordQueryPlanner)118 Assertions.assertEquals (org.junit.jupiter.api.Assertions.assertEquals)118 QueryComponent (com.apple.foundationdb.record.query.expressions.QueryComponent)117 List (java.util.List)114 MatcherAssert.assertThat (org.hamcrest.MatcherAssert.assertThat)114 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)113 Expressions.field (com.apple.foundationdb.record.metadata.Key.Expressions.field)107 Arrays (java.util.Arrays)107 Collections (java.util.Collections)106 ArrayList (java.util.ArrayList)100