Package org.voltdb

Examples of org.voltdb.VoltTable.fetchRow()


            // get the order line table
            VoltTable table = results[2];
            assertEquals(table.getColumnName(0), "OL_O_ID");
            assertTrue(table.getRowCount() == 1);
            VoltTableRow row = table.fetchRow(0);
            assertEquals(row.getLong("OL_O_ID"), 1);
            assertEquals(row.getLong("OL_D_ID"), 6);
            assertEquals(row.getLong("OL_W_ID"), 1);
            assertEquals(row.getLong("OL_QUANTITY"), 1);
            assertEquals(row.getLong("OL_SUPPLY_W_ID"), 5);
View Full Code Here


            assertEquals(results.length, 1);

            // get the new order table
            VoltTable table = results[0];
            assertTrue(table.getRowCount() == 1);
            VoltTableRow row = table.fetchRow(0);
            assertEquals(row.getLong("NO_D_ID"), 3);

        } catch (ProcCallException e) {
            e.printStackTrace();
            fail();
View Full Code Here

            // get the order line table
            VoltTable table = results[2];
            assertEquals(table.getColumnName(0), "OL_O_ID");
            assertTrue(table.getRowCount() == 1);
            VoltTableRow row = table.fetchRow(0);
            String resultString = row.getString("OL_DIST_INFO");
            assertEquals(testString, resultString);
        }
        catch (ProcCallException e) {
            e.printStackTrace();
View Full Code Here

            client.callProcedure("InsertOrderLine", 3L, 1L, 1L, 3L, 3L, 3L, 3L, 3L, 1.5, "def");
            VoltTable[] results = client.callProcedure("SelectOrderLineByDistInfo", testString).getResults();
            assertEquals(1, results.length);
            VoltTable table = results[0];
            assertTrue(table.getRowCount() == 1);
            VoltTableRow row = table.fetchRow(0);
            String resultString = row.getString("OL_DIST_INFO");
            assertEquals(testString, resultString);
        }
        catch (ProcCallException e) {
            e.printStackTrace();
View Full Code Here

        // Check each item
        VoltTable itemResults = neworder[2];
        assertEquals(quantities.length, itemResults.getRowCount());
        for (int i = 0; i < itemResults.getRowCount(); ++i) {
            VoltTableRow itemRow = itemResults.fetchRow(i);
            assertEquals("ITEM" + (i + 1), itemRow.getString("i_name"));
            //~ assertEquals(quantities[i], itemRow.getLong("));
            long expected = s_quantities[i] - quantities[i];
            if (expected < 10) expected += 91;
            assertEquals(expected, itemRow.getLong("s_quantity"));
View Full Code Here

        // verify that stock was updated correctly
        VoltTable[] allTables = client.callProcedure("SelectAll").getResults();
        VoltTable stock = allTables[TPCDataPrinter.nameMap.get("STOCK")];
        for (int i = 0; i < stock.getRowCount(); ++i) {
            VoltTableRow stockRow = stock.fetchRow(i);
            assertEquals(INITIAL_S_YTD + i*10 + quantities[i], stockRow.getLong("S_YTD"));
            assertEquals(INITIAL_S_ORDER_CNT + i*10 + 1, stockRow.getLong("S_ORDER_CNT"));
        }

        // New order with a missing item
View Full Code Here

        } catch (Exception e) {
            e.printStackTrace();
        }

        final int index = (namecnt-1)/2;
        final VoltTableRow customer = customers.fetchRow(index);
        final long c_id = customer.getLong(C_ID_IDX);

        voltQueueSQL(getWarehouse, W_ID);
        voltQueueSQL(getDistrict, W_ID, D_ID);
        final VoltTable[] results = voltExecuteSQL();
View Full Code Here

        assert(amt1 == amt2);

        voltQueueSQL(getDistricts);
        VoltTable districts = voltExecuteSQL()[0];
        assert(1 == districts.getRowCount());
        assert((initialYTD + paymentAmount) == districts.fetchRow(0).getDouble("D_YTD"));

        voltQueueSQL(getCustomers);
        VoltTable customersX = voltExecuteSQL()[0];
        assert(4 == customersX.getRowCount());
        assert((C_ID + 1) == customersX.fetchRow(1).getLong("C_ID"));
View Full Code Here

        assert((initialYTD + paymentAmount) == districts.fetchRow(0).getDouble("D_YTD"));

        voltQueueSQL(getCustomers);
        VoltTable customersX = voltExecuteSQL()[0];
        assert(4 == customersX.getRowCount());
        assert((C_ID + 1) == customersX.fetchRow(1).getLong("C_ID"));
        assert((initialBalance - paymentAmount) == customersX.fetchRow(1).getDouble("C_BALANCE"));
        assert((initialYTD + paymentAmount) == customersX.fetchRow(1).getDouble("C_YTD_PAYMENT"));
        assert(2 == customersX.fetchRow(1).getLong("C_PAYMENT_CNT"));

        return null;
View Full Code Here

        voltQueueSQL(getCustomers);
        VoltTable customersX = voltExecuteSQL()[0];
        assert(4 == customersX.getRowCount());
        assert((C_ID + 1) == customersX.fetchRow(1).getLong("C_ID"));
        assert((initialBalance - paymentAmount) == customersX.fetchRow(1).getDouble("C_BALANCE"));
        assert((initialYTD + paymentAmount) == customersX.fetchRow(1).getDouble("C_YTD_PAYMENT"));
        assert(2 == customersX.fetchRow(1).getLong("C_PAYMENT_CNT"));

        return 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.