Package org.voltdb.VoltTable

Examples of org.voltdb.VoltTable.ColumnInfo


        }
        assertEquals(10, rowcount);
    }

    public void testStupidAdvanceRowUse() {
        VoltTable table = new VoltTable(new ColumnInfo("foo", VoltType.BIGINT));
        table.addRow(5);
        // try to access value without calling advanceRow
        try {
            table.getLong(0);
            fail();
View Full Code Here


            } catch (Exception e) {
                Throwables.propagate(e);
            }

            return new DependencyPair(DEP_updateCatalogSync,
                    new VoltTable(new ColumnInfo[] { new ColumnInfo("UNUSED", VoltType.BIGINT) } ));
        }
        else if (fragmentId == SysProcFragmentId.PF_updateCatalogPrecheckAndSyncAggregate) {
            // Don't actually care about the returned table, just need to send something
            // back to the MPI scoreboard
            return new DependencyPair(DEP_updateCatalogSyncAggregate,
                    new VoltTable(new ColumnInfo[] { new ColumnInfo("UNUSED", VoltType.BIGINT) } ));
        }
        else if (fragmentId == SysProcFragmentId.PF_updateCatalog) {
            String catalogDiffCommands = (String)params.toArray()[0];
            String commands = Encoder.decodeBase64AndDecompress(catalogDiffCommands);
            int expectedCatalogVersion = (Integer)params.toArray()[1];
View Full Code Here

        empty.resetRowPosition();
        assertFalse(empty.advanceToRow(-1));
        empty.resetRowPosition();

        // Make a table with rows to navigate
        t = new VoltTable(new ColumnInfo("foo", VoltType.BIGINT),
                new ColumnInfo("bar", VoltType.STRING));
        for (int i = 0; i < 10; i++) {
            t.addRow(i, String.valueOf(i));
        }

        // Advance to each row one at a time
View Full Code Here

        VoltType types[] = { VoltType.TINYINT, VoltType.STRING,
                VoltType.INTEGER, VoltType.BIGINT, VoltType.FLOAT,
                VoltType.SMALLINT, VoltType.TIMESTAMP, VoltType.DECIMAL,
                VoltType.TINYINT };

        VoltTable tt = new VoltTable(new ColumnInfo("tinyint", types[0]),
                new ColumnInfo("string", types[1]), new ColumnInfo("integer",
                        types[2]), new ColumnInfo("bigint", types[3]),
                new ColumnInfo("float", types[4]), new ColumnInfo("smallint",
                        types[5]), new ColumnInfo("timestamp", types[6]),
                new ColumnInfo("decimal", types[7]), new ColumnInfo("tinyint",
                        types[0]));

        for (int i = 0; i < content.length; ++i) {
            Object[] vals = new Object[content.length];
            ;
View Full Code Here

    public void testFormattedString() throws JSONException, IOException {
        // Set the default timezone since we're using a timestamp type.  Eliminate test flakeyness.
        VoltDB.setDefaultTimezone();

        VoltTable table = new VoltTable(
                new ColumnInfo("tinyint", VoltType.TINYINT), new ColumnInfo(
                        "smallint", VoltType.SMALLINT), new ColumnInfo(
                        "integer", VoltType.INTEGER), new ColumnInfo("bigint",
                        VoltType.BIGINT), new ColumnInfo("float",
                        VoltType.FLOAT), new ColumnInfo("string",
                        VoltType.STRING), new ColumnInfo("varbinary",
                        VoltType.VARBINARY), new ColumnInfo("timestamp",
                        VoltType.TIMESTAMP), new ColumnInfo("decimal",
                        VoltType.DECIMAL));

        // add a row of nulls the hard way
        table.addRow(VoltType.NULL_TINYINT, VoltType.NULL_SMALLINT,
                VoltType.NULL_INTEGER, VoltType.NULL_BIGINT,
View Full Code Here

    }

    @SuppressWarnings("deprecation")
    public void testJSONRoundTrip() throws JSONException, IOException {
        VoltTable t1 = new VoltTable(
                new ColumnInfo("tinyint", VoltType.TINYINT), new ColumnInfo(
                        "smallint", VoltType.SMALLINT), new ColumnInfo(
                        "integer", VoltType.INTEGER), new ColumnInfo("bigint",
                        VoltType.BIGINT), new ColumnInfo("float",
                        VoltType.FLOAT), new ColumnInfo("string",
                        VoltType.STRING), new ColumnInfo("varbinary",
                        VoltType.VARBINARY), new ColumnInfo("timestamp",
                        VoltType.TIMESTAMP), new ColumnInfo("decimal",
                        VoltType.DECIMAL));

        // add a row of nulls the hard way
        t1.addRow(VoltType.NULL_TINYINT, VoltType.NULL_SMALLINT,
                VoltType.NULL_INTEGER, VoltType.NULL_BIGINT,
View Full Code Here

    }

    @Override
    protected void populateColumnSchema(ArrayList<ColumnInfo> columns) {
        super.populateColumnSchema(columns);
        columns.add(new ColumnInfo("TABLE", VoltType.STRING));
        columns.add(new ColumnInfo("PATH", VoltType.STRING));
        columns.add(new ColumnInfo("FILENAME", VoltType.STRING));
        columns.add(new ColumnInfo("NONCE", VoltType.STRING));
        columns.add(new ColumnInfo("TXNID", VoltType.BIGINT));
        columns.add(new ColumnInfo("START_TIME", VoltType.BIGINT));
        columns.add(new ColumnInfo("END_TIME", VoltType.BIGINT));
        columns.add(new ColumnInfo("SIZE", VoltType.BIGINT));
        columns.add(new ColumnInfo("DURATION", VoltType.BIGINT));
        columns.add(new ColumnInfo("THROUGHPUT", VoltType.FLOAT));
        columns.add(new ColumnInfo("RESULT", VoltType.STRING));
    }
View Full Code Here

* caller can compare against its own MD5 calculations. Can't return the data directly
* due to VoltTable size limitations (1 MB).
*/
public class BigFatBlobAndStringMD5 extends VoltProcedure {
    public VoltTable run(byte[] b, String s) {
        VoltTable t = new VoltTable(new ColumnInfo("b_md5", VoltType.VARBINARY),
                                    new ColumnInfo("s_md5", VoltType.VARBINARY));
        try {
            MessageDigest md5 = MessageDigest.getInstance("MD5");
            t.addRow(md5.digest(b), md5.digest(s.getBytes()));
        } catch (NoSuchAlgorithmException e) {
            // If the row wasn't added the test caller will consider it a failure.
View Full Code Here

    }

    private VoltTable constructPartitioningResultsTable() {
        ColumnInfo[] result_columns = new ColumnInfo[5];
        int ii = 0;
        result_columns[ii++] = new ColumnInfo(CNAME_HOST_ID, CTYPE_ID);
        result_columns[ii++] = new ColumnInfo(CNAME_SITE_ID, CTYPE_ID);
        result_columns[ii++] = new ColumnInfo(CNAME_PARTITION_ID, CTYPE_ID);
        result_columns[ii++] = new ColumnInfo("TABLE", VoltType.STRING);
        result_columns[ii++] = new ColumnInfo("MISPARTITIONED_ROWS", VoltType.BIGINT);
        return new VoltTable(result_columns);
    }
View Full Code Here

        return new VoltTable(result_columns);
    }

    private VoltTable constructHashinatorMatchesTable() {
        ColumnInfo [] columns = new ColumnInfo[] {
                new ColumnInfo(CNAME_HOST_ID, CTYPE_ID),
                new ColumnInfo(CNAME_SITE_ID, CTYPE_ID),
                new ColumnInfo(CNAME_PARTITION_ID, CTYPE_ID),
                new ColumnInfo("HASHINATOR_MATCHES", VoltType.TINYINT)
        };
        return new VoltTable(columns);
    }
View Full Code Here

TOP

Related Classes of org.voltdb.VoltTable.ColumnInfo

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.