Search in sources :

Example 61 with Database

use of org.voltdb.catalog.Database in project voltdb by VoltDB.

the class GenerateEETests method generatedMinPlan.

public void generatedMinPlan() throws Exception {
    Database db = getDatabase();
    TableConfig TConfig = makeTConfig(db);
    TableConfig testOutput = makeTestOutput(db);
    DBConfig minDB = new DBConfig(getClass(), GenerateEETests.class.getResource(DDL_FILENAME), getCatalogString(), TConfig, testOutput);
    minDB.addTest(new TestConfig("test_min_last_row", "select A, B, min(abs(5-C)) over (partition by A order by B) as R from T ORDER BY A, B, R;", false, testOutput));
    minDB.addTest(new TestConfig("test_min_middle_row", "select A, B, min(abs(3-C)) over (partition by A order by B) as R from T ORDER BY A, B, R;", false, testOutput));
    minDB.addTest(new TestConfig("test_min_first_row", "select A, B, min(abs(1-C)) over (partition by A order by B) as R from T ORDER BY A, B, R;", false, testOutput));
    generateTests("executors", "TestWindowedMin", minDB);
}
Also used : Database(org.voltdb.catalog.Database)

Example 62 with Database

use of org.voltdb.catalog.Database in project voltdb by VoltDB.

the class Site method loadTable.

@Override
public byte[] loadTable(long txnId, long spHandle, long uniqueId, String clusterName, String databaseName, String tableName, VoltTable data, boolean returnUniqueViolations, boolean shouldDRStream, boolean undo) throws VoltAbortException {
    Cluster cluster = m_context.cluster;
    if (cluster == null) {
        throw new VoltAbortException("cluster '" + clusterName + "' does not exist");
    }
    Database db = cluster.getDatabases().get(databaseName);
    if (db == null) {
        throw new VoltAbortException("database '" + databaseName + "' does not exist in cluster " + clusterName);
    }
    Table table = db.getTables().getIgnoreCase(tableName);
    if (table == null) {
        throw new VoltAbortException("table '" + tableName + "' does not exist in database " + clusterName + "." + databaseName);
    }
    return loadTable(txnId, spHandle, uniqueId, table.getRelativeIndex(), data, returnUniqueViolations, shouldDRStream, undo);
}
Also used : VoltTable(org.voltdb.VoltTable) Table(org.voltdb.catalog.Table) Database(org.voltdb.catalog.Database) Cluster(org.voltdb.catalog.Cluster) VoltAbortException(org.voltdb.VoltProcedure.VoltAbortException)

Aggregations

Database (org.voltdb.catalog.Database)62 Table (org.voltdb.catalog.Table)22 Catalog (org.voltdb.catalog.Catalog)12 Cluster (org.voltdb.catalog.Cluster)10 File (java.io.File)9 Column (org.voltdb.catalog.Column)9 Procedure (org.voltdb.catalog.Procedure)9 IOException (java.io.IOException)5 VoltTable (org.voltdb.VoltTable)5 ArrayList (java.util.ArrayList)4 Group (org.voltdb.catalog.Group)4 Connector (org.voltdb.catalog.Connector)3 Constraint (org.voltdb.catalog.Constraint)3 Statement (org.voltdb.catalog.Statement)3 FileNotFoundException (java.io.FileNotFoundException)2 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)2 SimpleDateFormat (java.text.SimpleDateFormat)2 HashMap (java.util.HashMap)2 CompletableFuture (java.util.concurrent.CompletableFuture)2 JAXBException (javax.xml.bind.JAXBException)2