Package org.voltdb.compiler

Examples of org.voltdb.compiler.VoltProjectBuilder.compile()


        String pathToDeployment = Configuration.getPathToCatalogForTest("adhocddl.xml");

        VoltProjectBuilder builder = new VoltProjectBuilder();
        builder.addLiteralSchema("--dont care");
        builder.setUseDDLSchema(true);
        boolean success = builder.compile(pathToCatalog, 2, 1, 0);
        assertTrue("Schema compilation failed", success);
        MiscUtils.copyFile(builder.getPathToDeployment(), pathToDeployment);

        VoltDB.Configuration config = new VoltDB.Configuration();
        config.m_pathToCatalog = pathToCatalog;
View Full Code Here


        builder.addStmtProcedure("nocrash", "select * from P1 where ID = 6000000000;");
        builder.addStmtProcedure("crash", "UPDATE P1 SET BIG = BIG + 4 WHERE P1.ID>= 5200704751286217677");
        builder.addStmtProcedure("crash2", "SELECT * FROM P1 WHERE P1.ID>-6611959682909750107");
        builder.addStmtProcedure("crash3", "SELECT * FROM P1 INNER JOIN R1 ON P1.ID = R1.BIG");
        builder.addStmtProcedure("crash4", "SELECT * FROM P1 WHERE P1.ID = 5 AND P1.TINY > -2000;");
        boolean success = builder.compile(Configuration.getPathToCatalogForTest("indexoverflow.jar"), 1, 1, 0);
        assert(success);
        MiscUtils.copyFile(builder.getPathToDeployment(), Configuration.getPathToCatalogForTest("indexoverflow.xml"));

        VoltDB.Configuration config = new VoltDB.Configuration();
        config.m_pathToCatalog = Configuration.getPathToCatalogForTest("indexoverflow.jar");
View Full Code Here

        builder.addLiteralSchema(schema);
        builder.addPartitionInfo("STRINGS", "ID");
        builder.addStmtProcedure("Insert", "insert into strings values (?, ?, ?);", null);
        builder.addStmtProcedure("SelectLike", "select * from strings where  val like ?;");
        builder.addStmtProcedure("SelectNotLike", "select * from strings where  val not like ?;");
        boolean success = builder.compile(pathToCatalog, 2, 1, 0);
        assertTrue("Insert compilation failed", success);
        MiscUtils.copyFile(builder.getPathToDeployment(), pathToDeployment);

        VoltDB.Configuration config = new VoltDB.Configuration();
        config.m_pathToCatalog = pathToCatalog;
View Full Code Here

                "constraint PK_TREE_R primary key (ID)" +
                ");\n"
                );
        builder.addPartitionInfo("FOO", "ID");
        builder.setUseDDLSchema(true);
        boolean success = builder.compile(pathToCatalog, 2, 1, 0);
        assertTrue("Schema compilation failed", success);
        MiscUtils.copyFile(builder.getPathToDeployment(), pathToDeployment);

        VoltDB.Configuration config = new VoltDB.Configuration();
        config.m_pathToCatalog = pathToCatalog;
View Full Code Here

        builder.addPartitionInfo("table2", "column1");
        builder.addPartitionInfo("table3", "column1");
        builder.addStmtProcedure("SelectT1", "select * from table1 where column1 = ? and column2 = ?;", "table1.column1:0");
        builder.addStmtProcedure("SelectT2", "select * from table2 where column1 = ? and column2 = ?;", "table1.column1:0");
        builder.addStmtProcedure("SelectT3", "select * from table3 where column1 = ? and column2 = ?;", "table1.column1:0");
        boolean success = builder.compile(Configuration.getPathToCatalogForTest("indexordertest.jar"), 1, 1, 0);
        assertTrue(success);
    }
}
View Full Code Here

        String pathToCatalog = Configuration.getPathToCatalogForTest("updateclasses.jar");
        String pathToDeployment = Configuration.getPathToCatalogForTest("updateclasses.xml");
        VoltProjectBuilder builder = new VoltProjectBuilder();
        builder.addLiteralSchema("-- Don't care");
        builder.setUseDDLSchema(true);
        boolean success = builder.compile(pathToCatalog, 2, 1, 0);
        assertTrue("Schema compilation failed", success);
        MiscUtils.copyFile(builder.getPathToDeployment(), pathToDeployment);

        try {
            LocalCluster cluster = new LocalCluster("updateclasses.jar", 2, 1, 0, BackendTarget.NATIVE_EE_JNI);
View Full Code Here

        String pathToDeployment = Configuration.getPathToCatalogForTest("updateclasses.xml");
        VoltProjectBuilder builder = new VoltProjectBuilder();
        // Start off with the dependency imported
        builder.addLiteralSchema("import class org.voltdb_testprocs.updateclasses.NoMeaningClass;");
        builder.setUseDDLSchema(true);
        boolean success = builder.compile(pathToCatalog, 2, 1, 0);
        assertTrue("Schema compilation failed", success);
        MiscUtils.copyFile(builder.getPathToDeployment(), pathToDeployment);

        try {
            LocalCluster cluster = new LocalCluster("updateclasses.jar", 2, 1, 0, BackendTarget.NATIVE_EE_JNI);
View Full Code Here

        builder.addLiteralSchema("\nCREATE TABLE A (C1 BIGINT NOT NULL, C2 BIGINT NOT NULL);");
        builder.addLiteralSchema("\nCREATE VIEW MATVIEW(C1, NUM) AS " +
                                 "\n    SELECT C1, COUNT(*) FROM A GROUP BY C1;");
        builder.addPartitionInfo("A", "C1");
        builder.addProcedures(org.voltdb.catalog.ProcedureA.class);
        builder.compile(testDir + File.separator + "addpredmatview1.jar");
        Catalog catOriginal = catalogForJar(testDir + File.separator + "addpredmatview1.jar");

        // without a view
        builder = new VoltProjectBuilder();
        builder.addLiteralSchema("\nCREATE TABLE A (C1 BIGINT NOT NULL, C2 BIGINT NOT NULL);");
View Full Code Here

        builder.addLiteralSchema("\nCREATE TABLE A (C1 BIGINT NOT NULL, C2 BIGINT NOT NULL);");
        builder.addLiteralSchema("\nCREATE VIEW MATVIEW(C1, NUM) AS " +
                                 "\n    SELECT C1, COUNT(*) FROM A WHERE C1 > 0 GROUP BY C1;");
        builder.addPartitionInfo("A", "C1");
        builder.addProcedures(org.voltdb.catalog.ProcedureA.class);
        builder.compile(testDir + File.separator + "addpredmatview2.jar");
        Catalog catUpdated = catalogForJar(testDir + File.separator + "addpredmatview2.jar");

        verifyDiffRejected(catOriginal, catUpdated);
    }

View Full Code Here

        builder.addLiteralSchema("\nCREATE TABLE A (C1 BIGINT NOT NULL, C2 BIGINT NOT NULL);");
        builder.addLiteralSchema("\nCREATE VIEW MATVIEW(C1, NUM) AS " +
                                 "\n    SELECT C1, COUNT(*) FROM A WHERE C1 > 0 GROUP BY C1;");
        builder.addPartitionInfo("A", "C1");
        builder.addProcedures(org.voltdb.catalog.ProcedureA.class);
        builder.compile(testDir + File.separator + "droppredmatview1.jar");
        Catalog catOriginal = catalogForJar(testDir + File.separator + "droppredmatview1.jar");

        // without a view
        builder = new VoltProjectBuilder();
        builder.addLiteralSchema("\nCREATE TABLE A (C1 BIGINT NOT NULL, C2 BIGINT NOT NULL);");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.