Package com.foundationdb.qp.rowtype

Examples of com.foundationdb.qp.rowtype.Schema


     *   GroupScan (table group)
     *  
     *  
     */
    public static Operator generateScanPlan (AkibanInformationSchema ais, Table table) {
        final Schema schema = SchemaCache.globalSchema(ais);
        Operator plan = API.groupScan_Default(table.getGroup());
        final List<RowType> keepTypes = new ArrayList<>();
        table.visit(new AbstractVisitor() {
            @Override
            public void visit(Table table) {
                keepTypes.add(schema.tableRowType(table));
            }
        });
        plan = API.filter_Default(plan, keepTypes);

        if (logger.isDebugEnabled()) {
View Full Code Here


     * Branch Lookup
     *   Index Scan (table, pk-> ?[, ?...])
     */
    public static Operator generateBranchPlan (AkibanInformationSchema ais, Table table) {
        final Operator indexScan = generateIndexScan(ais, table);
        final Schema schema = SchemaCache.globalSchema(ais);
        PrimaryKey pkey = table.getPrimaryKeyIncludingInternal();
        IndexRowType indexType = schema.indexRowType(pkey.getIndex());
        return generateBranchPlan(table, indexScan, indexType);
    }
View Full Code Here

    }

    @Override
    protected void setupPostCreateSchema()
    {
        schema = new Schema(ais());
        tRowType = schema.tableRowType(table(t));
        xyIndexRowType = indexType(t, "x", "y");
        adapter = newStoreAdapter(schema);
        queryContext = queryContext(adapter);
        queryBindings = queryContext.createBindings();
View Full Code Here

        IndexRowType indexType = schema.indexRowType(pkey.getIndex());
        return generateBranchPlan(table, indexScan, indexType);
    }

    public static Operator generateBranchPlan (Table table, Operator scan, RowType scanType) {
        final Schema schema = (Schema)scanType.schema();
        final TableRowType tableType = schema.tableRowType(table);
        final List<TableRowType> tableTypes = new ArrayList<>();
        tableTypes.add(tableType);
        for (RowType rowType : Schema.descendentTypes(tableType, schema.userTableTypes())) {
            tableTypes.add((TableRowType)rowType);
        }
        Operator plan = API.groupLookup_Default(scan, table.getGroup(),
                                                scanType, tableTypes,
                                                API.InputPreservationOption.DISCARD_INPUT, 1);
View Full Code Here

     * Generates a plan like
     * AncestorScan (Table)
     *   IndexScan (table, pk->?[, ?])
     */
    public static Operator generateAncestorPlan (AkibanInformationSchema ais, Table table) {
        final Schema schema = SchemaCache.globalSchema(ais);
        TableRowType tableType = schema.tableRowType(table);

        List<TableRowType> ancestorType = new ArrayList<>(1);
        ancestorType.add (tableType);

        IndexRowType indexType = schema.indexRowType(table.getPrimaryKeyIncludingInternal().getIndex());
       
        Operator indexScan = generateIndexScan (ais, table);
        Operator lookup = API.groupLookup_Default(indexScan,
                table.getGroup(),
                indexType,
View Full Code Here

     * @param ais
     * @param table
     * @return Operator plan for the Index scan
     */
    private static Operator generateIndexScan (AkibanInformationSchema ais, Table table) {
        final Schema schema = SchemaCache.globalSchema(ais);
        PrimaryKey pkey = table.getPrimaryKeyIncludingInternal();
        final int nkeys = pkey.getColumns().size();
        IndexRowType indexType = schema.indexRowType(pkey.getIndex());

        List<TPreparedExpression> pexprs = new ArrayList<>(nkeys);
        for (int i = 0; i < nkeys; i++) {
            pexprs.add(new TPreparedParameter(i, indexType.typeAt(i)));
        }
View Full Code Here

    }

    @Override
    protected void setupPostCreateSchema()
    {
        schema = new Schema(ais());
        parentRowType = schema.tableRowType(table(parent));
        childRowType = schema.tableRowType(table(child));
        childPKRowType = indexType(child, "cid");
        db = new Row[] {
            row(parent, 1L, 1L),
View Full Code Here

    }

    @Override
    protected void setupPostCreateSchema()
    {
        schema = new Schema(ais());
        tRowType = schema.tableRowType(table(t));
        group = group(t);
        List<Row> rows = new ArrayList<>();
        Random random = new Random(123456789);
        long key = 0;
View Full Code Here

    }

    @Override
    protected void setupPostCreateSchema()
    {
        schema = new Schema(ais());
        tRowType = schema.tableRowType(table(t));
        tPidIndexRowType = indexType(t, "pid");
        tXIndexRowType = indexType(t, "x");
        coi = group(t);
        adapter = newStoreAdapter(schema);
View Full Code Here

    }

    @Override
    protected void setupPostCreateSchema()
    {
        schema = new Schema(ais());
        pRowType = schema.tableRowType(table(p));
        pNIndexRowType = indexType(p, "pn");
        c1RowType = schema.tableRowType(table(c1));
        c1NIndexRowType = indexType(c1, "cn");
        c2RowType = schema.tableRowType(table(c2));
View Full Code Here

TOP

Related Classes of com.foundationdb.qp.rowtype.Schema

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.