Package com.foundationdb.qp.operator

Examples of com.foundationdb.qp.operator.QueryContext


                                                 Table table,
                                                 RowData rowData)
    {
        Operator plan = PlanGenerator.generateBranchPlan(table.getAIS(), table);
        StoreAdapter adapter = createAdapter(session, SchemaCache.globalSchema(table.getAIS()));
        QueryContext queryContext = new SimpleQueryContext(adapter);
        QueryBindings queryBindings = queryContext.createBindings();
        Cursor cursor = API.cursor(plan, queryContext, queryBindings);

        List<Column> lookupCols = table.getPrimaryKeyIncludingInternal().getColumns();
        RowDataValueSource pSource = new RowDataValueSource();
        for(int i = 0; i < lookupCols.size(); ++i) {
View Full Code Here


            this.session = session;
            AkibanInformationSchema ais = getAIS(session);
            Table changesTable = ais.getTable(CHANGES_TABLE);
            Operator plan = API.groupScan_Default(changesTable.getGroup());
            StoreAdapter adapter = store.createAdapter(session, SchemaCache.globalSchema(ais));
            QueryContext context = new SimpleQueryContext(adapter);
            this.cursor = API.cursor(plan, context, context.createBindings());
            cursor.open();
            findNextIndex();
        }
View Full Code Here

        compareRows(expected, cursor(plan));
    }

    private Cursor cursor(Operator plan) {
        StoreAdapter adapter = newStoreAdapter(schema);
        QueryContext context = queryContext(adapter);
        QueryBindings bindings = context.createBindings();
        return API.cursor(plan, context, bindings);
    }
View Full Code Here

        RowsBuilder inputRows = createBuilder(input);
        Schema schema = SchemaCache.globalSchema(ddl().getAIS(session()));
        StoreAdapter adapter = newStoreAdapter(schema);
        TestOperator inputOperator = new TestOperator(inputRows);

        QueryContext context = queryContext(adapter);
        QueryBindings bindings = context.createBindings();
        Cursor inputCursor = API.cursor(inputOperator, context, bindings);
        inputCursor.openTopLevel();

        API.Ordering ordering = API.ordering();
        for(int i = 0; i < fieldOrdering.length; ++i) {
View Full Code Here

        @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();
                } catch (Throwable e) {
View Full Code Here

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

        QueryContext context = queryContext(adapter);
        QueryBindings bindings = context.createBindings();
        Cursor inputCursor = API.cursor(
                API.groupScan_Default(table.getGroup()),
                context, bindings
        );
View Full Code Here

    }

    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(
                        API.indexScan_Default(type, false, IndexKeyRange.unbounded(type)),
                        queryContext, queryBindings
View Full Code Here

        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),
                        testRow(indexRowType, "a", 111, 1, 10, 101),
                        testRow(indexRowType, "a", 122, 1, 11, 111),
View Full Code Here

        for (int i = 0; i < expected.length; i++) {
            rows[i] = new TestRow(rowType, expected[i]);
        }
       
        StoreAdapter adapter = newStoreAdapter(schema);
        QueryContext queryContext = new SimpleQueryContext(adapter);
       
        List<TableRowType> keepTypes = Arrays.asList(rowType);
       
        compareRows (
                rows,
                API.cursor(API.filter_Default(API.groupScan_Default(table.getGroup()),
                            keepTypes),
                        queryContext,
                        queryContext.createBindings())
            );
    }
View Full Code Here

        Row[] rows = new Row[expected.length];
        for(int i = 0; i < expected.length; ++i) {
            rows[i] = new TestRow(rowType, expected[i]);
        }
        StoreAdapter adapter = newStoreAdapter(schema);
        QueryContext queryContext = new SimpleQueryContext(adapter);
        compareRows(
            rows,
            API.cursor(
                API.indexScan_Default(rowType, false, IndexKeyRange.unbounded(rowType)),
                queryContext,
                queryContext.createBindings()
            )
        );
    }
View Full Code Here

TOP

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

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.