Package org.voltdb.catalog

Examples of org.voltdb.catalog.Column


     * testGetChangedEntries
     */
    @Test
    public void testGetChangedEntries() {
        Table catalog_tbl = this.getTable("WAREHOUSE");
        Column catalog_col = this.getColumn(catalog_tbl, "W_NAME");

        // First check they are the same
        final PartitionPlan pplan0 = PartitionPlan.createFromCatalog(catalog_db);
        assertNotNull(pplan0);
        final PartitionPlan pplan1 = PartitionPlan.createFromCatalog(catalog_db);
View Full Code Here


    /**
     * testMultiColumn
     */
    public void testMultiColumn() throws Exception {
        Table catalog_tbl = this.getTable(TM1Constants.TABLENAME_SUBSCRIBER);
        Column columns[] = {
            this.getColumn(catalog_tbl, "S_ID"),
            this.getColumn(catalog_tbl, "SUB_NBR"),
        };
       
        MultiColumn item0 = MultiColumn.get(columns);
View Full Code Here

     * testVerticalPartitionColumn
     */
    @SuppressWarnings("unchecked")
    public void testVerticalPartitionColumn() throws Exception {
        Table catalog_tbl = this.getTable(TM1Constants.TABLENAME_SUBSCRIBER);
        Column orig_hp_col = this.getColumn(catalog_tbl, "S_ID");
        MultiColumn orig_vp_col = MultiColumn.get(this.getColumn(catalog_tbl, "S_ID"),
                                                  this.getColumn(catalog_tbl, "SUB_NBR"));
       
        VerticalPartitionColumn item0 = VerticalPartitionColumn.get(orig_hp_col, orig_vp_col);
        assertNotNull(item0);
View Full Code Here

            CatalogUtil.getVoltTable(catalog_tbl),
            CatalogUtil.getVoltTable(catalog_tbl)
        };
        assertEquals(NUM_PARTITIONS, vts.length);
        AbstractHasher hasher = p_estimator.getHasher();
        Column sub_nbr = catalog_tbl.getColumns().getIgnoreCase("SUB_NBR");
        Column sf_type = catalog_tbl.getColumns().getIgnoreCase("SF_TYPE");
        Column start_time = catalog_tbl.getColumns().getIgnoreCase("START_TIME");
       
        for (int i = 0; i < NUM_TUPLES; i++) {
            Object row[] = VoltTableUtil.getRandomRow(catalog_tbl);
            row[0] = Integer.valueOf(i);
           
            // Column Fixes
            if (sub_nbr != null) row[sub_nbr.getIndex()] = row[0].toString();
            if (sf_type != null) row[sf_type.getIndex()] = 1l;
            if (start_time != null) row[start_time.getIndex()] = 1l;
           
            vts[hasher.hash(row[0])].addRow(row);
        } // FOR
        for (int i = 0; i < vts.length; i++) {
            PartitionExecutor executor = hstore_site.getPartitionExecutor(i);
View Full Code Here

       
        // We want to always insert one SUBSCRIBER record per partition so
        // that we can play with them. Set VLR_LOCATION to zero so that
        // can check whether it has been modified
        Table catalog_tbl = this.getTable(TM1Constants.TABLENAME_SUBSCRIBER);
        Column catalog_col = this.getColumn(catalog_tbl, "VLR_LOCATION");
        VoltTable vt = CatalogUtil.getVoltTable(catalog_tbl);
        for (int i = 0; i < NUM_PARTITIONS; i++) {
            Object row[] = VoltTableUtil.getRandomRow(catalog_tbl);
            row[0] = new Long(i);
            row[catalog_col.getIndex()] = 0l;
            vt.addRow(row);
        } // FOR
        String procName = VoltSystemProcedure.procCallName(LoadMultipartitionTable.class);
        ClientResponse cr = this.client.callProcedure(procName, catalog_tbl.getName(), vt);
        assertEquals(cr.toString(), Status.OK, cr.getStatus());
View Full Code Here

        // Output Columns
        int index = 0;
        for (Integer plancol : plan.columns) {
            PlanColumn planColumn = planner.getPlannerContext().get(plancol);
            Column column = catalogStmt.getOutput_columns().add(planColumn.getDisplayName()); // String.valueOf(index));
            column.setNullable(false);
            column.setIndex(index);
//            column.setName(planColumn.displayName());
            column.setType(planColumn.type().getValue());
            column.setSize(planColumn.width());
            index++;
        }

        CompiledPlan.Fragment fragment = plan.fragments.get(0);
        PlanNodeList nodeList = new PlanNodeList(fragment.planGraph);
View Full Code Here

        AccessGraph agraph = new AccessGraph(catalog_db);
        new AccessGraphGenerator(this.info, this.catalog_proc).generate(agraph);
        agraph.setVerbose(true);
       
        Table catalog_tbl = this.getTable("STOCK");
        Column catalog_col = this.getColumn(catalog_tbl, "S_W_ID");
       
        DesignerVertex v = agraph.getVertex(catalog_tbl);
        assertNotNull(v);
        Collection<DesignerEdge> edges = agraph.findEdgeSet(v, catalog_col);
        assertNotNull(edges);
View Full Code Here

        final VoltTable vt = this.loadTable(client);
       
        Database catalog_db = CatalogUtil.getDatabase(this.getCatalog());
        Table catalog_tbl = catalog_db.getTables().get("TABLEC");
        assertNotNull(catalog_tbl);
        Column catalog_col = catalog_tbl.getColumns().get("C_VALUE0");
        assertNotNull(catalog_col);
       
        // Compute the AVG in Java so that we can compare
        Map<Integer, List<Integer>> values = new HashMap<Integer, List<Integer>>();
        vt.resetRowPosition();
        while (vt.advanceRow()) {
            int c_b_a_id = (int)vt.getLong(2) % num_partitions;
            if (values.containsKey(c_b_a_id) == false) {
                values.put(c_b_a_id, new ArrayList<Integer>());
            }
            values.get(c_b_a_id).add((int)vt.getLong(catalog_col.getIndex()));
        } // WHILE
        Map<Integer, Double> expectedValues = new HashMap<Integer, Double>();
        for (Integer c_b_a_id : values.keySet()) {
            int total = 0;
            for (Integer val : values.get(c_b_a_id))
View Full Code Here

       
        // First Test: Only partition one of the tables and make sure that
        // the MultiColumns don't map to the same partition
       
        Table catalog_tbl = this.getTable(clone_db, TM1Constants.TABLENAME_SPECIAL_FACILITY);
        Column catalog_cols[] = new Column[] {
            this.getColumn(clone_db, catalog_tbl, "S_ID"),
            this.getColumn(clone_db, catalog_tbl, "SF_TYPE"),
        };
        MultiColumn mc = MultiColumn.get(catalog_cols);
        assertNotNull(mc);
View Full Code Here

        assert(mpp.getIndex() >= 0);
        catalog_proc.setPartitionparameter(mpp.getIndex());
        p_estimator.initCatalog(clone_catalogContext);
       
        Table catalog_tbl = this.getTable(clone_db, TM1Constants.TABLENAME_ACCESS_INFO);
        Column catalog_cols[] = new Column[] {
            this.getColumn(clone_db, catalog_tbl, "S_ID"),
            this.getColumn(clone_db, catalog_tbl, "DATA1"),
        };
        MultiColumn mc = MultiColumn.get(catalog_cols);
        assertNotNull(mc);
View Full Code Here

TOP

Related Classes of org.voltdb.catalog.Column

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.