Package edu.brown.catalog.special

Examples of edu.brown.catalog.special.MultiColumn


                    if (readOnlyColumns.contains(col))
                        all_cols.add(col);
                } // FOR

                if (partition_col instanceof MultiColumn) {
                    MultiColumn mc = (MultiColumn) partition_col;
                    if (mc.size() == all_cols.size()) {
                        boolean foundAll = true;
                        for (Column col : mc) {
                            foundAll = all_cols.contains(col) && foundAll;
                        } // FOR
                        if (foundAll)
                            continue;
                        // assert(foundAll) : mc + "\n" + all_cols;
                    }
                }
               
                if (all_cols.size() > 1) {
                    MultiColumn vp_col = MultiColumn.get(all_cols.toArray(new Column[all_cols.size()]));
                    assert (partition_col.equals(vp_col) == false) : vp_col;
                    VerticalPartitionColumn vpc = VerticalPartitionColumn.get(partition_col, vp_col);
                    assert (vpc != null) : String.format("Failed to get VerticalPartition column for <%s, %s>", partition_col, vp_col);
                    candidates.add(vpc);
   
                    if (debug.val) {
                        Map<String, Object> m = new ListOrderedMap<String, Object>();
                        m.put("Output Columns", output_cols);
                        m.put("Predicate Columns", stmt_cols);
                        m.put("Horizontal Partitioning", partition_col.fullName());
                        m.put("Vertical Partitioning", vp_col.fullName());
                        LOG.debug("Vertical Partition Candidate: " + catalog_stmt.fullName() + "\n" + StringUtil.formatMaps(m));
                    }
                }
            } // FOR (stmt)
        } // FOR (proc)
View Full Code Here


     */
    public void testCloneDatabaseMultiColumn() throws Exception {
        // We want to make sure that it clones MultiColumns too!
        Table catalog_tbl = this.getTable("WAREHOUSE");
        Column columns[] = new Column[] { this.getColumn(catalog_tbl, "W_NAME"), this.getColumn(catalog_tbl, "W_YTD"), };
        MultiColumn mc = MultiColumn.get(columns);
        assertNotNull(mc);
        catalog_tbl.setPartitioncolumn(mc);

        Database clone_db = CatalogCloner.cloneDatabase(catalog_db);
        assertNotNull(clone_db);

        Table clone_tbl = this.getTable(clone_db, catalog_tbl.getName());
        Column clone_col = clone_tbl.getPartitioncolumn();
        assertNotNull(clone_col);
        assert (clone_col instanceof MultiColumn);
        MultiColumn clone_mc = (MultiColumn) clone_col;
        assertEquals(mc.size(), clone_mc.size());

        for (int i = 0; i < mc.size(); i++) {
            Column catalog_col = mc.get(i);
            assertNotNull(catalog_col);
            clone_col = clone_mc.get(i);
            assertNotNull(clone_col);
            assertEquals(catalog_col, clone_col);
            assertNotSame(catalog_col.hashCode(), clone_col.hashCode());
        } // FOR
    }
View Full Code Here

     */
    public void testMultiColumn() throws Exception {
        Table catalog_tbl = this.getTable(TM1Constants.TABLENAME_SUBSCRIBER);
        Column catalog_cols[] = { this.getColumn(catalog_tbl, "S_ID"), this.getColumn(catalog_tbl, "SUB_NBR"), this.getColumn(catalog_tbl, "VLR_LOCATION"), };

        MultiColumn item0 = MultiColumn.get(catalog_cols);
        assertNotNull(item0);
        assertEquals(catalog_cols.length, item0.size());

        String key = CatalogKey.createKey(item0);
        assertNotNull(key);
        assertFalse(key.isEmpty());
        // System.err.println("----------------------------------");
        // System.err.println(mc + " ==> " + key);

        MultiColumn clone = (MultiColumn) CatalogKey.getFromKey(catalog_db, key, Column.class);
        assertNotNull(clone);
        assertEquals(catalog_cols.length, clone.size());
        for (int i = 0; i < item0.size(); i++) {
            assertEquals(item0.get(i), item0.get(i));
        } // FOR
    }
View Full Code Here

     * testVerticalPartitionColumn
     */
    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"), this.getColumn(catalog_tbl, "VLR_LOCATION"));

        VerticalPartitionColumn item0 = VerticalPartitionColumn.get(orig_hp_col, orig_vp_col);
        assertNotNull(item0);

        String key = CatalogKey.createKey(item0);
        assertNotNull(key);
        assertFalse(key.isEmpty());
        // System.err.println(item0 + "\n" + key);

        MultiColumn clone = (MultiColumn) CatalogKey.getFromKey(catalog_db, key, Column.class);
        assertNotNull(clone);
        assertEquals(item0.size(), clone.size());
    }
View Full Code Here

        Table catalog_tbl = this.getTable(clone_db, TM1Constants.TABLENAME_ACCESS_INFO);
        Column columns[] = {
            this.getColumn(clone_db, catalog_tbl, "S_ID"),
            this.getColumn(clone_db, catalog_tbl, "AI_TYPE"),
        };
        MultiColumn catalog_col = MultiColumn.get(columns);
        assertNotNull(catalog_col);
        catalog_tbl.setPartitioncolumn(catalog_col);
//        System.err.println(catalog_tbl + ": " + catalog_col);

        SingleSitedCostModel cost_model = new SingleSitedCostModel(clone_catalogContext);
View Full Code Here

TOP

Related Classes of edu.brown.catalog.special.MultiColumn

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.