Package com.foundationdb.qp.operator

Examples of com.foundationdb.qp.operator.StoreAdapter


    {
        @Override
        public void run()
        {
            try(Session session = createNewSession()) {
                StoreAdapter adapter = newStoreAdapter(session, schema);
                QueryContext queryContext = queryContext(adapter);
                try(TransactionService.CloseableTransaction txn = txnService().beginCloseableTransaction(session)) {
                    plan.run(queryContext, queryBindings);
                    dump(cursor(groupScan_Default(group), queryContext, queryBindings));
                    txn.commit();
View Full Code Here


    }

    private void doSort() {
        InOutTap tap = Tap.createTimer("test");
        Schema schema = SchemaCache.globalSchema(ddl().getAIS(session()));
        StoreAdapter adapter = newStoreAdapter(schema);

        Table table = getTable(SCHEMA, TABLE);
        RowType rowType = schema.tableRowType(table);
        API.Ordering ordering = API.ordering();
        ordering.append(ExpressionGenerators.field(rowType, 1), true);
View Full Code Here

        return schema.indexRowType(index);
    }

    private void scanAndCheckIndex(IndexRowType type, Row... expectedRows) {
        Schema schema = SchemaCache.globalSchema(ddl().getAIS(session()));
        StoreAdapter adapter = newStoreAdapter(schema);
        QueryContext queryContext = new SimpleQueryContext(adapter);
        QueryBindings queryBindings = queryContext.createBindings();
        compareRows(
                expectedRows,
                API.cursor(
View Full Code Here

        Schema schema = SchemaCache.globalSchema(ddl().getAIS(session()));
        RowType cType = schema.tableRowType(getTable(SCHEMA, "c"));
        RowType oType = schema.tableRowType(getTable(SCHEMA, "o"));
        RowType iType = schema.tableRowType(getTable(SCHEMA, "i"));
        StoreAdapter adapter = newStoreAdapter(schema);
        int pk = 1;
        compareRows(
                new Row[]{
                        testRow(cType, 1, "a"),
                        testRow(oType, 10, 1, 11, pk++),
                        testRow(oType, 11, 1, 12, pk++),
                        testRow(cType, 2, "b"),
                        testRow(oType, 30, 3, 33, pk++),
                },
                adapter.newGroupCursor(cType.table().getGroup())
        );
        compareRows(
                new Row[]{
                        testRow(iType, 100, 10, 110),
                        testRow(iType, 101, 10, 111),
                        testRow(iType, 111, 11, 122),
                        testRow(iType, 300, 30, 330)
                },
                adapter.newGroupCursor(iType.table().getGroup())
        );
    }
View Full Code Here

        assertEquals("Index column count", 2, index.getKeyColumns().size());

        Schema schema = SchemaCache.globalSchema(ddl().getAIS(session()));
        IndexRowType indexRowType = schema.indexRowType(index);

        StoreAdapter adapter = newStoreAdapter(schema);
        QueryContext queryContext = new SimpleQueryContext(adapter);
        QueryBindings queryBindings = queryContext.createBindings();
        compareRows(
                new Row[] {
                        testRow(indexRowType, "a", 110, 1, 10, 100),
View Full Code Here

        Schema schema = SchemaCache.globalSchema(ddl().getAIS(session()));
        RowType cType = schema.tableRowType(getTable(SCHEMA, "c"));
        RowType oType = schema.tableRowType(getTable(SCHEMA, "o"));
        RowType iType = schema.tableRowType(getTable(SCHEMA, "i"));

        StoreAdapter adapter = newStoreAdapter(schema);
        compareRows(
                new Row[] {
                        // null c
                            // no o20
                                testRow(iType, 200, 20, "d"),
                        testRow(cType, 1L, "asdf"),
                            testRow(oType, 10, 1, "a"),
                                testRow(iType, 100, 10, "d"),
                                testRow(iType, 101, 10, "e"),
                                testRow(iType, 102, 10, "f"),
                            testRow(oType, 11, 1, "b"),
                        testRow(cType, 5, "qwer"),
                        // no c6
                            testRow(oType, 60, 6, "c"),
                        testRow(cType, 10, "zxcv")

                },
                adapter.newGroupCursor(cType.table().getGroup())
        );
    }
View Full Code Here

        Schema schema = SchemaCache.globalSchema(ddl().getAIS(session()));
        RowType cType = schema.tableRowType(getTable(SCHEMA, "c"));
        RowType oType = schema.tableRowType(getTable(SCHEMA, "o"));

        StoreAdapter adapter = newStoreAdapter(schema);
        compareRows(
                new Row[] {
                        testRow(cType, 1L, "asdf"),
                        testRow(cType, 5, "qwer"),
                        testRow(cType, 10, "zxcv")
                },
                adapter.newGroupCursor(cType.table().getGroup())
        );
        compareRows(
                new Row[] {
                        testRow(oType, 10, 1, "a"),
                        testRow(oType, 11, 1, "b"),
                        testRow(oType, 60, 6, "c"),
                },
                adapter.newGroupCursor(oType.table().getGroup())
        );
    }
View Full Code Here

        Schema schema = SchemaCache.globalSchema(ddl().getAIS(session()));
        RowType cType = schema.tableRowType(getTable(SCHEMA, "c"));
        RowType oType = schema.tableRowType(getTable(SCHEMA, "o"));
        RowType iType = schema.tableRowType(getTable(SCHEMA, "i"));

        StoreAdapter adapter = newStoreAdapter(schema);
        compareRows(
                new Row[] {
                        // ?
                            // null
                                testRow(iType, 200, 20, "d"),
                        testRow(cType, 1, "asdf"),
                            testRow(oType, 10, 1, "a"),
                                testRow(iType, 100, 10, "d"),
                                testRow(iType, 101, 10, "e"),
                                testRow(iType, 102, 10, "f"),
                            testRow(oType, 11, 1, "b"),
                        testRow(cType, 5, "qwer"),
                        // null
                            testRow(oType, 60, 6, "c"),
                        testRow(cType, 10, "zxcv"),
                },
                adapter.newGroupCursor(cType.table().getGroup())
        );
    }
View Full Code Here

        Schema schema = SchemaCache.globalSchema(ddl().getAIS(session()));
        RowType cType = schema.tableRowType(getTable(SCHEMA, "c"));
        RowType oType = schema.tableRowType(getTable(SCHEMA, "o"));
        RowType iType = schema.tableRowType(getTable(SCHEMA, "i"));

        StoreAdapter adapter = newStoreAdapter(schema);
        compareRows(
                new Row[] {
                        testRow(cType, 1, "asdf"),
                        testRow(cType, 5, "qwer"),
                        testRow(cType, 10, "zxcv")
                },
                adapter.newGroupCursor(cType.table().getGroup())
        );

        compareRows(
                new Row[] {
                        testRow(oType, 10, 1, "a"),
                            testRow(iType, 100, 10, "d"),
                            testRow(iType, 101, 10, "e"),
                            testRow(iType, 102, 10, "f"),
                        testRow(oType, 11, 1, "b"),
                        // none
                            testRow(iType, 200, 20, "d"),
                        testRow(oType, 60, 6, "c"),
                },
                adapter.newGroupCursor(oType.table().getGroup())
        );
    }
View Full Code Here

        writeRows(row(oid, "dd", 4L));

        Schema schema = SchemaCache.globalSchema(ddl().getAIS(session()));
        RowType cType = schema.tableRowType(getTable(SCHEMA, C_TABLE));
        RowType oType = schema.tableRowType(getTable(SCHEMA, O_TABLE));
        StoreAdapter adapter = newStoreAdapter(schema);
        compareRows(
                new Row[] {
                        testRow(cType, 1L, "a"),
                            testRow(oType, "aa", 1L, 1L),
                        testRow(cType, 2L, "b"),
                            testRow(oType, "bb", 2L, 2L),
                        testRow(cType, 3L, "c"),
                            testRow(oType, "cc", 3L, 3L),
                        testRow(cType, 4L, "d"),
                            testRow(oType, "dd", 4L, 4L),
                },
                adapter.newGroupCursor(cType.table().getGroup())
        );
    }
View Full Code Here

TOP

Related Classes of com.foundationdb.qp.operator.StoreAdapter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.