Package com.foundationdb.ais.model

Examples of com.foundationdb.ais.model.TableName


            "cafter int not null", // cid mod 5
            "clat decimal(11, 7)", // plat + cid % 10
            "clon decimal(11, 7)", // plon + cid % 10
            "primary key(cid)",
            "grouping foreign key(pid) references parent(pid)");
        groupName = new TableName("schema", "parent");
        createSpatialGroupIndex(groupName, "pbefore_clat_clon_cafter",
                                1, Spatial.LAT_LON_DIMENSIONS, Index.JoinType.LEFT,
                                "parent.pbefore", "child.clat", "child.clon", "child.cafter");
        createSpatialGroupIndex(groupName, "pbefore_plat_plon_cafter",
                                1, Spatial.LAT_LON_DIMENSIONS, Index.JoinType.LEFT,
View Full Code Here


    //

    @Test
    public void addGroupingForeignKey_C() {
        String xTable = "x";
        TableName xName = new TableName(SCHEMA, xTable);
        int xid = createTable(xName, "id varchar(5) not null primary key");
        writeRows(
                row(xid, "1"), // Adopts 1 (well formed group)
                                        // Leave 2 orphan
                row(xid, "4"), // Adopts 2 (c has no children)
View Full Code Here

        createIndex(SCHEMA, "customers", "name_dob", "name", "dob_year");
        int oTable = createTable(SCHEMA, "orders", "oid int not null primary key, cid varchar(4), placed varchar(64)",
                akibanFK("cid", "customers", "cid"));
        createIndex(SCHEMA, "orders", "placed", "placed");
        // schema: GIs
        TableName groupName = getTable(SCHEMA, "customers").getGroup().getName();
        namePlacedGi = createLeftGroupIndex(groupName, "namePlaced", "customers.name", "orders.placed");

        // insert data
        int startingCid = 0;
        int endingCid = CUSTOMERS_COUNT;
View Full Code Here

        createSpatialTableIndex("schem", "tab", "idxgeo", 0, 2, "lat", "lon");
        writeRow(cid, 10L, "10", "11");
        getStats(cid);
        serviceManager().getDXL().ddlFunctions().updateTableStatistics(session(),
                new TableName("schem", "tab"), Collections.singleton("idxgeo"));
        getStats(cid);
    }
View Full Code Here

        createSpatialTableIndex("schem", "tab", "idxgeo", 0, 2, "lat", "lon", "name");
        writeRow(cid, 10L, "10", "11", "foo");
        getStats(cid);
        serviceManager().getDXL().ddlFunctions().updateTableStatistics(session(),
                new TableName("schem", "tab"), Collections.singleton("idxgeo"));
        getStats(cid);
    }
View Full Code Here

        int cid = createTable("schem", "cust", "id int not null primary key", "lat decimal(11,07)", "lon decimal(11,7)",
                "name varchar(32)");
        int oid = createTable("schem", "orders", "id int not null primary key", "cid int not null", "colour varchar(3)",
                akibanFK("cid", "cust", "id"));

        TableName groupName = ais().getTable("schem", "cust").getGroup().getName();

        createSpatialGroupIndex(groupName, "idxgeogrp", 0, Spatial.LAT_LON_DIMENSIONS, Index.JoinType.LEFT,
                                "cust.lat", "cust.lon", "orders.colour");
        writeRow(cid, 10L, "10", "11", "foo");
        writeRow(oid, 20L, 10L, "red");
        getStats(cid);
        serviceManager().getDXL().ddlFunctions().updateTableStatistics(session(),
                new TableName("schem", "orders"), Collections.singleton("idxgeogrp"));
        getStats(cid);
        getStats(cid);
    }
View Full Code Here

    @Test(expected=NotAllowedByConfigException.class)
    public void groupIndex() {
        createTable("test", "c", "id int not null primary key, x int");
        createTable("test", "a", "id int not null primary key, cid int, lat decimal(11,7), lon decimal(11,7), grouping foreign key(cid) references c(id)");
        createSpatialGroupIndex(new TableName("test", "c"), "s", 1, 2, JoinType.LEFT, "c.x", "a.lat", "a.lon");
    }
View Full Code Here

import static org.junit.Assert.assertNotNull;

public class TableIDCollisionIT extends ITBase {
    private Table simpleISTable() {
        final TableName FAKE_TABLE = new TableName(TableName.INFORMATION_SCHEMA, "fake_table");
        NewAISBuilder builder = AISBBasedBuilder.create(ddl().getTypesTranslator());
        builder.table(FAKE_TABLE).colInt("id").pk("id");
        Table table = builder.ais().getTable(FAKE_TABLE);
        assertNotNull("Found table", table);
        return table;
View Full Code Here

    }

    private void expectSequences (String schemaName, String... sequenceNames) {
        final AkibanInformationSchema ais = ddl().getAIS(session());
        for (String name : sequenceNames) {
            final Sequence sequence = ais.getSequence(new TableName(schemaName, name));
            assertNotNull (schemaName + "." + name + " doesn't exist", sequence);
        }
       
    }
View Full Code Here

       
    }
    private void expectNotSequence (String schemaName, String... sequenceNames) {
        final AkibanInformationSchema ais = ddl().getAIS(session());
        for (String name : sequenceNames) {
            final Sequence sequence = ais.getSequence(new TableName(schemaName, name));
            assertNull (schemaName + "." + name + " still exists", sequence);
        }
    }
View Full Code Here

TOP

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

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.