Package com.foundationdb.ais.model

Examples of com.foundationdb.ais.model.Index


                cid,
                row(cid, "C", 10),
                row(cid, "B", 20),
                row(cid, "A", 50)
        );
        Index index = getTable(SCHEMA, "c").getIndex(Index.PRIMARY);
        expectRows(
                index,
                row(index, 10),
                row(index, 20),
                row(index, 50)
View Full Code Here


                row(tableId, 1, 2, 3, null),
                row(tableId, 4, 5, 6, null),
                row(tableId, 7, 8, 9, null)
        );

        Index index =getTable(tableId).getIndex("c4");
        expectRows(
                index,
                row(index, null, 1),
                row(index, null, 2),
                row(index, null, 3)
View Full Code Here

                row(cid, 10, 101, 102)
        );

        runAlter("ALTER TABLE c DROP COLUMN c1");

        Index index = getTable(SCHEMA, "c").getIndex("c1_c2");
        expectRows(
                index,
                row(index, 12, 1),
                row(index, 22, 2),
                row(index, 32, 3),
View Full Code Here

        createLeftGroupIndex(C_NAME, "c1_o1_o2", "c.c1", "o.o1", "i.i1");

        runAlter("ALTER TABLE o DROP COLUMN o1");

        AkibanInformationSchema ais = ddl().getAIS(session());
        Index index = ais.getGroup(C_NAME).getIndex("c1_o1_o2");
        assertNotNull("Index still exists", index);
        assertEquals("Index column count", 2, index.getKeyColumns().size());

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

        StoreAdapter adapter = newStoreAdapter(schema);
View Full Code Here

        createLeftGroupIndex(new TableName(SCHEMA, "c"), "c1_o1_i1", "c.c1", "o.o1", "i.i1");

        runAlter(ChangeLevel.GROUP, "ALTER TABLE o DROP GROUPING FOREIGN KEY");

        AkibanInformationSchema ais = ddl().getAIS(session());
        Index index = ais.getGroup(C_NAME).getIndex("c1_o1_i1");
        assertNull("Index should not exist on c group", index);
        index = ais.getGroup(O_NAME).getIndex("c1_o1_i1");
        assertNull("Index should not exist on o group", index);
    }
View Full Code Here

                cid,
                row(cid, 1, 10),
                row(cid, 2, 20),
                row(cid, 3, 30)
        );
        Index index = getTable(SCHEMA, "c").getIndex("c1");
        expectRows(
                index,
                row(index, 10, 1),
                row(index, 20, 2),
                row(index, 30, 3)
View Full Code Here

    @Test
    public void addUniqueKeyExistingColumn() throws StandardException {
        createAndLoadSingleTableGroup();
        runAlter(ChangeLevel.INDEX, "ALTER TABLE c ADD UNIQUE(c1)");
        expectIndexes(cid, "PRIMARY", "c1");
        Index index = getTable(SCHEMA, "c").getIndex("c1");
        expectRows(
                index,
                row(index, "10", 1),
                row(index, "20", 2),
                row(index, "30", 3)
View Full Code Here

        changes.add(TableChange.createAdd("foo"));

        ddl().alterTable(session(), new TableName(SCHEMA, "c"), table, NO_CHANGES, changes, queryContext());

        expectIndexes(cid, "foo", "PRIMARY");
        Index index = getTable(SCHEMA, "c").getIndex("foo");
        expectRows(
                index,
                row(index, "1", 3),
                row(index, "2", 2),
                row(index, "3", 1)
View Full Code Here

        changes.add(TableChange.createModify("foo", "foo"));

        ddl().alterTable(session(), new TableName(SCHEMA, "c"), table, NO_CHANGES, changes, queryContext());

        expectIndexes(cid, "foo", "PRIMARY");
        Index index = getTable(SCHEMA, "c").getIndex("foo");
        expectRows(
                index,
                row(index, "1", "C", 3L),
                row(index, "2", "B", 2L),
                row(index, "3", "A", 1L)
View Full Code Here

                row(oid, 30, 3, null)
        );

        expectIndexes(oid, "PRIMARY", "x", "y");

        Index index = getTable(SCHEMA, "o").getIndex("x");
        expectRows(
                index,
                row(index, null, 1, 10),
                row(index, null, 1, 11),
                row(index, null, 3, 30)
View Full Code Here

TOP

Related Classes of com.foundationdb.ais.model.Index

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.