Package com.foundationdb.qp.rowtype

Examples of com.foundationdb.qp.rowtype.Schema


    public void createAndLoad() {
        cID = createTable(SCHEMA, C_TABLE, "cid INT NOT NULL PRIMARY KEY, w INT");
        aID = createTable(SCHEMA, A_TABLE, "aid INT NOT NULL PRIMARY KEY, cid INT, x INT, GROUPING FOREIGN KEY(cid) REFERENCES c(cid)");
        oID = createTable(SCHEMA, O_TABLE, "oid INT NOT NULL PRIMARY KEY, cid INT, y INT, GROUPING FOREIGN KEY(cid) REFERENCES c(cid)");
        iID = createTable(SCHEMA, I_TABLE, "iid INT NOT NULL PRIMARY KEY, oid INT, z INT, GROUPING FOREIGN KEY(oid) REFERENCES o(oid)");
        Schema schema = SchemaCache.globalSchema(ais());
        cRowType = schema.tableRowType(cID);
        aRowType = schema.tableRowType(aID);
        oRowType = schema.tableRowType(oID);
        iRowType = schema.tableRowType(iID);
        writeRows(// unknown
                    // no O(65, 6)
                                row(iID, 650, 65, 650000),           // 0
                            row(cID, 2, 2000),                       // 1
                        row(aID, 20, 2, 20000),                      // 2
View Full Code Here


            "cid2 int not null primary key",
            "pid int",
            "cid2_copy int," +
            "grouping foreign key(pid) references parent(pid)");
        createIndex("schema", "child2", "idx_cid2_copy", "cid2_copy");
        schema = new Schema(ais());
        grandparentRowType = schema.tableRowType(table(grandparent));
        parentRowType = schema.tableRowType(table(parent));
        child1RowType = schema.tableRowType(table(child1));
        child2RowType = schema.tableRowType(table(child2));
        group = group(grandparent);
View Full Code Here

        Operator plan = scanIndexPlan(index);
        return runPlan(session(), SchemaCache.globalSchema(table.getAIS()), plan);
    }

    protected List<Row> scanAll(Group group) {
        Schema schema = SchemaCache.globalSchema(group.getAIS());
        return runPlan(session(), schema, API.groupScan_Default(group));
    }
View Full Code Here

        Schema schema = SchemaCache.globalSchema(group.getAIS());
        return runPlan(session(), schema, API.groupScan_Default(group));
    }

    private Operator scanTablePlan(Table table) {
        Schema schema = SchemaCache.globalSchema(table.getAIS());
        return API.filter_Default(API.groupScan_Default(table.getGroup()), Arrays.asList(schema.tableRowType(table)));
    }
View Full Code Here

        Schema schema = SchemaCache.globalSchema(table.getAIS());
        return API.filter_Default(API.groupScan_Default(table.getGroup()), Arrays.asList(schema.tableRowType(table)));
    }

    protected Operator scanIndexPlan(Index index) {
        Schema schema = SchemaCache.globalSchema(index.getAIS());
        return API.indexScan_Default(schema.indexRowType(index));
    }
View Full Code Here

            "index(address)");
        coi = group(customer);
        TableName groupName = coi.getName();
        createLeftGroupIndex(groupName, "name_salesman", "customer.name", "order.salesman");
        createLeftGroupIndex(groupName, "name_address", "customer.name", "address.address");
        schema = new Schema(ais());
        customerRowType = schema.tableRowType(table(customer));
        orderRowType = schema.tableRowType(table(order));
        itemRowType = schema.tableRowType(table(item));
        addressRowType = schema.tableRowType(table(address));
        customerNameIndexRowType = indexType(customer, "name");
View Full Code Here

        return API.indexScan_Default(schema.indexRowType(index));
    }

    protected final List<Row> scanAllIndex(Index index) {
        AkibanInformationSchema ais = ais();
        Schema schema = SchemaCache.globalSchema(ais);
        Operator plan = API.indexScan_Default(schema.indexRowType(index));
        return runPlan(session(), schema, plan);
    }
View Full Code Here

    protected void expectRowsSkipInternal(Index index, Row... expectedRows) {
        expectRows(scanIndexPlan(index), true, Arrays.asList(expectedRows));
    }

    protected void expectRows(Operator plan, boolean skipInternal, Collection<Row> expectedRows) {
        Schema schema = SchemaCache.globalSchema(ais());
        expectRows(schema, plan, skipInternal, expectedRows);
    }
View Full Code Here

        return row(session(), tableID, fields);
    }

    public Row row(Session session, int tableID, Object... fields) {
        AkibanInformationSchema ais = ais(session);
        Schema schema = SchemaCache.globalSchema(ais);
        RowType rowType = schema.tableRowType(tableID);
        return row(rowType, fields);
    }
View Full Code Here

        return row(rowType, fields);
    }

    public Row row(Index index, Object... fields) {
        AkibanInformationSchema ais = ais(session());
        Schema schema = SchemaCache.globalSchema(ais);
        RowType rowType = schema.indexRowType(index);
        return row(rowType, fields);
    }
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.