Package com.foundationdb.qp.rowtype

Examples of com.foundationdb.qp.rowtype.Schema


        String schemaName = schemaName();
        String tableName = newTableName();
        t = createTable(schemaName, tableName,
                        "id int not null",
                        "primary key(id)");
        schema = new Schema(ais());
        tRowType = schema.tableRowType(table(t));
        group = group(t);
        adapter = newStoreAdapter(schema);
        queryContext = queryContext(adapter);
        queryBindings = queryContext.createBindings();
View Full Code Here


    protected List<Row> runPlanTxn(final OperatorCreator creator) {
        return txnService().run(session(), new Callable<List<Row>>() {
            @Override
            public List<Row> call() throws Exception {
                Schema schema = SchemaCache.globalSchema(ais());
                Operator plan = creator.create(schema);
                StoreAdapter adapter = store().createAdapter(session(), schema);
                QueryContext context = new SimpleQueryContext(adapter, serviceManager());
                QueryBindings bindings = context.createBindings();
                List<Row> rows = new ArrayList<>();
View Full Code Here

            "aid int not null key",
            "cid int",
            "address varchar(100)",
            "constraint __akiban_ac foreign key __akiban_ac(cid) references customer(cid)",
            "index(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

        for(Group group : ais.getGroups().values()) {
            for(Index index : group.getIndexes()) {
                index.computeFieldAssociations(ordinalMap);
            }
        }
        schema = new Schema (ais);
        customerPK = schema.indexRowType(customers.getIndex(Index.PRIMARY));
        itemPK = schema.indexRowType(ais.getTable("Test", CAOIBuilderFiller.ITEM_TABLE).getIndex(Index.PRIMARY));
        testCreator = new TestKeyCreator(schema);
    }
View Full Code Here

    }

    protected static List<TableRowType> branchOutputRowTypes(TableRowType outputRowType) {
        List<TableRowType> outputRowTypes = new ArrayList<>();
        outputRowTypes.add(outputRowType);
        Schema schema = (Schema)outputRowType.schema();
        for (RowType rowType : Schema.descendentTypes(outputRowType, schema.userTableTypes())) {
            outputRowTypes.add((TableRowType)rowType);
        }
        return outputRowTypes;
    }
View Full Code Here

    }

    @Test
    public void writeRowHKeyChangePropagation() {
        final TableIds tids = createTables();
        Schema schema = SchemaCache.globalSchema(ddl().getAIS(session()));
        RowType cType = schema.tableRowType(getTable(tids.c));
        RowType oType = schema.tableRowType(getTable(tids.o));
        RowType iType = schema.tableRowType(getTable(tids.i));
        StoreAdapter adapter = newStoreAdapter(schema);

        Object[] o1Cols = { 10, 1 };
        Object[] cCols = { 2, "c2" };
        Object[] oCols = { 20, 2 };
View Full Code Here

    }

    @Test
    public void deleteRowHKeyChangePropagation() {
        final TableIds tids = createTables();
        Schema schema = SchemaCache.globalSchema(ddl().getAIS(session()));
        RowType cType = schema.tableRowType(getTable(tids.c));
        RowType oType = schema.tableRowType(getTable(tids.o));
        RowType iType = schema.tableRowType(getTable(tids.i));
        StoreAdapter adapter = newStoreAdapter(schema);

        Object[] o1Cols = { 10, 1 };
        Object[] cCols = { 2, "c2" };
        Object[] oCols = { 20, 2 };
View Full Code Here

    }

    @Test
    public void updateRowHKeyChangePropagation() {
        final TableIds tids = createTables();
        Schema schema = SchemaCache.globalSchema(ddl().getAIS(session()));
        RowType cType = schema.tableRowType(getTable(tids.c));
        RowType oType = schema.tableRowType(getTable(tids.o));
        RowType iType = schema.tableRowType(getTable(tids.i));
        StoreAdapter adapter = newStoreAdapter(schema);

        Object[] o1Cols = { 10, 1 };
        Object[] cCols = { 2, "c2" };
        Object[] oOrig = { 1, 1 };
View Full Code Here

    }

    @Override
    protected void setupPostCreateSchema()
    {
        schema = new Schema(ais());
        tRowType = schema.tableRowType(table(t));
        idxRowType = indexType(t, "a", "b", "c");
        db = new Row[] {
            row(t, 0L, 1010L, 1L, 11L, 110L),
            row(t, 1L, 1011L, 1L, 13L, 130L),
View Full Code Here

        i = createTable(SCHEMA, "i", "iid int not null primary key, o_id int", "sku varchar(6)", akibanFK("o_id", "o", "oid"));
        h = createTable(SCHEMA, "h", "hid int not null primary key, i_id int", akibanFK("i_id", "i", "iid"));
        TableName groupName = getTable(c).getGroup().getName();
        GroupIndex gi = createLeftGroupIndex(groupName, GI_NAME, "o.when", "i.sku");

        schema = new Schema(ddl().getAIS(session()));
        adapter = newStoreAdapter(schema);
        queryContext = queryContext(adapter);
        queryBindings = queryContext.createBindings();
        giRowType = schema.indexRowType(gi);
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.