Package org.voltdb

Examples of org.voltdb.VoltTableRow


    private Object pickRandomVal(VoltTable table, Column col)
    {
        int size = table.getRowCount();
        int i_row = RandUtil.randLong(0, size - 1).intValue();
        VoltTableRow row = table.fetchRow(i_row);
        return row.get(col.getIndex(), VoltType.get((byte) col.getType()));
    }
View Full Code Here


    @SuppressWarnings("unchecked")
    public class VRowComparator<T> implements Comparator {

        @Override
        public int compare(Object arg0, Object arg1) {
            VoltTableRow r1 = (VoltTableRow)arg0;
            VoltTableRow r2 = (VoltTableRow)arg1;

            String r1d1 = (String) r1.get(0, VoltType.STRING);
            String r1d2 = (String) r1.get(1, VoltType.STRING);
            String r2d1 = (String) r2.get(0, VoltType.STRING);
            String r2d2 = (String) r2.get(1, VoltType.STRING);

            int r1d1_pos = Integer.valueOf(r1d1.substring(3));
            int r1d2_pos = Integer.valueOf(r1d2.substring(3));
            int r2d1_pos = Integer.valueOf(r2d1.substring(3));
            int r2d2_pos = Integer.valueOf(r2d2.substring(3));
View Full Code Here

                                             aggs[i], table, table);
                VoltTable[] results = client.callProcedure("@AdHoc", query).getResults();
                if (aggs[i].equals("count")) {
                    assertEquals(0, results[0].asScalarLong());
                } else {
                    final VoltTableRow row = results[0].fetchRow(0);
                    row.get(0, results[0].getColumnType(0));
                    if (!isHSQL()) {
                        assertTrue(row.wasNull());
                    }
                }
            }
            // Do avg separately since the column is a float and makes
            // asScalarLong() unhappy
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);
            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);

            assertTrue(true);

        } catch (ProcCallException e) {
            e.printStackTrace();
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();
        } catch (IOException e) {
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();
            fail();
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();
            fail();
View Full Code Here

        } catch (ProcCallException e) {
            e.printStackTrace();
            fail();
        }
        assertEquals(1, results.length);
        VoltTableRow row = results[0].fetchRow(0);

        assertEquals(1, row.getLong(0));
        assertEquals(0, row.getString(2).compareTo(longString));
    }
View Full Code Here

        } catch (ProcCallException e) {
            e.printStackTrace();
            fail();
        }
        assertEquals(1, results.length);
        VoltTableRow row = results[0].fetchRow(0);

        assertEquals(1, row.getLong(0));
        assertEquals(0, row.getString(2).compareTo(longString));
    }
View Full Code Here

            }

            // verify that the row was inserted
            try {
                final VoltTable[] result = client.callProcedure("Select", "ALLOW_NULLS", pkey.get()).getResults();
                final VoltTableRow row = result[0].fetchRow(0);
                for (int i=0; i < COLS; ++i) {
                    final Object obj = row.get(i+1, m_types[i]);
                    if (i == k) {
                        assertTrue(row.wasNull());
                        System.out.println("Row " + i + " verifed as NULL");
                    }
                    else {
                        assertTrue( comparisonHelper(obj, params[i+2], m_types[i]) );
                    }
View Full Code Here

TOP

Related Classes of org.voltdb.VoltTableRow

Copyright © 2018 www.massapicom. 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.