Search in sources :

Example 61 with VoltTable

use of org.voltdb.VoltTable in project voltdb by VoltDB.

the class TestUndoSuite method testMultibatchSPGoodThenMPFail.

public void testMultibatchSPGoodThenMPFail() throws IOException, ProcCallException {
    final Client client = this.getClient();
    doSpLoad(client, 100);
    doMpRollback(client, 0);
    doMpRollback(client, 1);
    doMpRollback(client, 2);
    VoltTable[] results = client.callProcedure("CountP1").getResults();
    assertEquals(100, results[0].asScalarLong());
}
Also used : Client(org.voltdb.client.Client) VoltTable(org.voltdb.VoltTable)

Example 62 with VoltTable

use of org.voltdb.VoltTable in project voltdb by VoltDB.

the class TestUnionSuite method testMultipleSetOperations5.

/**
     * (A.I) except (B.I except C.I) except (D.I)
     * @throws NoConnectionsException
     * @throws IOException
     * @throws ProcCallException
     */
public void testMultipleSetOperations5() throws NoConnectionsException, IOException, ProcCallException {
    Client client = getClient();
    VoltTable vt;
    // in A and B and C, not in D. Eliminated by inner EXCEPT, so IN final result.
    client.callProcedure("InsertA", 0, 0);
    // in A and B, not in C and D. Eliminated by the first outer EXCEPT.
    client.callProcedure("InsertA", 1, 1);
    // in A and has no effect in C and not in D. IN final result set.
    client.callProcedure("InsertA", 2, 2);
    // in A and D. Eliminated by the second outer EXCEPT
    client.callProcedure("InsertA", 3, 3);
    // in A and B and C, not in D. Eliminated by inner EXCEPT, so IN final result.
    client.callProcedure("InsertB", 0, 0);
    // in A and B, not in C and D. Eliminated by the first outer EXCEPT.
    client.callProcedure("InsertB", 1, 1);
    // Not in A. Has no effect in B and C. Not in final result.
    client.callProcedure("InsertB", 4, 4);
    // Not in A. Has no effect in B. Not in final result.
    client.callProcedure("InsertB", 5, 5);
    // in A and B and C, not in D. Eliminated by inner EXCEPT, so IN final result.
    client.callProcedure("InsertC", 0, 0);
    // in A and has no effect in C and D. IN final result set.
    client.callProcedure("InsertC", 2, 2);
    // Not in A. Has no effect in B and C. Not in final result.
    client.callProcedure("InsertC", 4, 4);
    // Not in A. Has no effect in C. Not in final result.
    client.callProcedure("InsertC", 6, 6);
    // in A and D only. Eliminated by the second outer EXCEPT.
    client.callProcedure("InsertD", 1, 3);
    vt = client.callProcedure("@AdHoc", "(SELECT I FROM A) EXCEPT (SELECT I FROM B EXCEPT SELECT I FROM C) " + "EXCEPT SELECT I FROM D order by i;").getResults()[0];
    assertEquals(2, vt.getRowCount());
    validateTableOfScalarLongs(vt, new long[] { 0, 2 });
}
Also used : Client(org.voltdb.client.Client) VoltTable(org.voltdb.VoltTable)

Example 63 with VoltTable

use of org.voltdb.VoltTable in project voltdb by VoltDB.

the class TestUnionSuite method testMultipleSetOperations3.

/**
     * A.I intersect all (B.I except all C.I)
     * @throws NoConnectionsException
     * @throws IOException
     * @throws ProcCallException
     */
public void testMultipleSetOperations3() throws NoConnectionsException, IOException, ProcCallException {
    Client client = this.getClient();
    VoltTable vt;
    // in A but not in B-C. Eliminated by final INTERSECT
    client.callProcedure("InsertA", 0, 0);
    // in A but not in B-C. Eliminated by final INTERSECT
    client.callProcedure("InsertA", 1, 1);
    // in A but not in B-C. Eliminated by final INTERSECT
    client.callProcedure("InsertA", 2, 1);
    // in A and in B-C. In final result set
    client.callProcedure("InsertA", 3, 2);
    // in A and in B-C. In final result set
    client.callProcedure("InsertA", 4, 2);
    // in A but not in B-C. Eliminated by final INTERSECT
    client.callProcedure("InsertA", 5, 2);
    // in B and C. Eliminated by B-C
    client.callProcedure("InsertB", 1, 0);
    // in B and C. Eliminated by B-C
    client.callProcedure("InsertB", 2, 1);
    // in B-C and in A. In final result set
    client.callProcedure("InsertB", 3, 2);
    // in B-C and in A. In final result set
    client.callProcedure("InsertB", 4, 2);
    // in B and C. Eliminated by B-C
    client.callProcedure("InsertC", 1, 1);
    // in B and C. Eliminated by B-C
    client.callProcedure("InsertC", 3, 0);
    // not in B. Eliminated by B-C
    client.callProcedure("InsertC", 4, 3);
    vt = client.callProcedure("@AdHoc", "SELECT I FROM A INTERSECT ALL " + "(SELECT I FROM B EXCEPT ALL SELECT I FROM C);").getResults()[0];
    assertEquals(2, vt.getRowCount());
    validateTableOfScalarLongs(vt, new long[] { 2, 2 });
}
Also used : Client(org.voltdb.client.Client) VoltTable(org.voltdb.VoltTable)

Example 64 with VoltTable

use of org.voltdb.VoltTable in project voltdb by VoltDB.

the class TestSystemProcedureSuite method testUpdateLogging.

public void testUpdateLogging() throws Exception {
    Client client = getClient();
    VoltTable[] results = null;
    results = client.callProcedure("@UpdateLogging", m_loggingConfig).getResults();
    for (VoltTable result : results) {
        assertEquals(0, result.asScalarLong());
    }
}
Also used : Client(org.voltdb.client.Client) VoltTable(org.voltdb.VoltTable)

Example 65 with VoltTable

use of org.voltdb.VoltTable in project voltdb by VoltDB.

the class TestSystemCatalogSuite method testProceduresSelector.

public void testProceduresSelector() throws IOException, ProcCallException {
    Client client = getClient();
    VoltTable[] results = client.callProcedure("@SystemCatalog", "PROCEDURES").getResults();
    assertEquals(9, results[0].getColumnCount());
    System.out.println(results[0]);
}
Also used : Client(org.voltdb.client.Client) VoltTable(org.voltdb.VoltTable)

Aggregations

VoltTable (org.voltdb.VoltTable)887 Client (org.voltdb.client.Client)497 ClientResponse (org.voltdb.client.ClientResponse)193 ProcCallException (org.voltdb.client.ProcCallException)144 IOException (java.io.IOException)100 VoltTableRow (org.voltdb.VoltTableRow)57 NoConnectionsException (org.voltdb.client.NoConnectionsException)52 ColumnInfo (org.voltdb.VoltTable.ColumnInfo)42 TimestampType (org.voltdb.types.TimestampType)37 BigDecimal (java.math.BigDecimal)30 ArrayList (java.util.ArrayList)27 Test (org.junit.Test)26 File (java.io.File)25 HashMap (java.util.HashMap)21 ClientResponseImpl (org.voltdb.ClientResponseImpl)20 Timestamp (java.sql.Timestamp)15 Date (java.util.Date)15 VoltDB (org.voltdb.VoltDB)15 DependencyPair (org.voltdb.DependencyPair)14 Configuration (org.voltdb.VoltDB.Configuration)14