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);
}
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);
}
Aggregations