Package edu.brown.catalog.special

Examples of edu.brown.catalog.special.MultiColumn


        assertNotNull(multicolumns);
        assertEquals(1, multicolumns.size());
        assert(multicolumns.containsKey(catalog_tbl));
       
        // XXX: What if there are multiple MultiColumns?
        MultiColumn mc = CollectionUtil.first(multicolumns.get(catalog_tbl));
        assertNotNull(mc);
       
        System.err.println("COLUMNS: " + multicolumns);
        for (int i = 0; i < expected.length; i++) {
            assertEquals(mc.toString(), expected[i], mc.get(i));
        } // FOR
    }
View Full Code Here


        String table_key = CatalogKey.createKey(catalog_tbl);
        Column catalog_cols[] = new Column[] {
            this.getColumn(clone_db, catalog_tbl, "D_ID"),
            this.getColumn(clone_db, catalog_tbl, "D_W_ID"),
        };
        MultiColumn mc = MultiColumn.get(catalog_cols);
        assertNotNull(mc);
        catalog_tbl.setPartitioncolumn(mc);
        p_estimator.initCatalog(clone_catalogContext);
       
        // Procedure Partition
View Full Code Here

        Table catalog_tbl = this.getTable(clone_db, TPCCConstants.TABLENAME_DISTRICT);
        String table_key = CatalogKey.createKey(catalog_tbl);
       
        Column catalog_col0 = this.getColumn(clone_db, catalog_tbl, "D_ID");
        Column catalog_col1 = this.getColumn(clone_db, catalog_tbl, "D_W_ID");
        MultiColumn mc = MultiColumn.get(catalog_col0, catalog_col1);
        catalog_tbl.setPartitioncolumn(mc);
//        System.err.println("MUTLI COLUMN: " + mc);
       
        Procedure catalog_proc = this.getProcedure(clone_db, neworder.class);
        Statement catalog_stmt = this.getStatement(clone_db, catalog_proc, "getDistrict");
View Full Code Here

        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);
        catalog_tbl.setPartitioncolumn(mc);
        p_estimator.initCatalog(clone_catalogContext);
       
        Statement catalog_stmt = this.getStatement(clone_db, catalog_proc, "GetData");
View Full Code Here

        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);
        catalog_tbl.setPartitioncolumn(mc);
        p_estimator.initCatalog(clone_catalogContext);
       
        Statement catalog_stmt = this.getStatement(clone_db, catalog_proc, "GetData");
View Full Code Here

                if (trace.val)
                    LOG.trace(String.format("%s - MultiColumn Candidate: %s", catalog_stmt.fullName(), catalog_col0.fullName()));
                for (Column catalog_col1 : columns) {
                    if (catalog_col0.equals(catalog_col1) || !catalog_tbl.equals(catalog_col1.getParent()))
                        continue;
                    MultiColumn mc = MultiColumn.get(catalog_col0, catalog_col1);
                    assert (mc != null);
                    multicolumns.get(catalog_tbl).add(mc);
                } // FOR
            } // FOR
        } // FOR
View Full Code Here

        // Need to also clone the MultiColumn guys too!
        for (Table catalog_tbl : catalog_db.getTables()) {
            Table clone_tbl = clone_db.getTables().get(catalog_tbl.getName());
            for (Column catalog_col : catalog_tbl.getColumns()) {
                if (catalog_col instanceof MultiColumn) {
                    MultiColumn mc = (MultiColumn) catalog_col;
                    Column clone_cols[] = new Column[mc.size()];
                    for (int i = 0; i < clone_cols.length; i++) {
                        clone_cols[i] = clone_tbl.getColumns().get(mc.get(i).getName());
                    } // FOR

                    MultiColumn clone_mc = MultiColumn.get(clone_cols);
                    assert (clone_mc != null);
                }
            }
            assert (catalog_tbl.getColumns().size() == clone_tbl.getColumns().size()) : catalog_tbl.getColumns() + " != " + clone_tbl.getColumns();
        } // FOR
View Full Code Here

                // Special Case: Replicated Column Marker
                if (src_part_col instanceof ReplicatedColumn) {
                    dest_part_col = ReplicatedColumn.get(dest_tbl);
                // Special Case: MultiColumn
                } else if (src_part_col instanceof MultiColumn) {
                    MultiColumn mc = (MultiColumn) src_part_col;
                    Column dest_cols[] = new Column[mc.size()];
                    for (int i = 0; i < dest_cols.length; i++) {
                        dest_cols[i] = dest_tbl.getColumns().get(mc.get(i).getName());
                    } // FOR
                    dest_part_col = MultiColumn.get(dest_cols);

                } else {
                    dest_part_col = dest_tbl.getColumns().get(src_part_col.getName());
View Full Code Here

        assert (catalog_col != null) : "Null partition column: " + catalog_tbl;
        assert ((catalog_col instanceof VerticalPartitionColumn) == false) : "Invalid partitioning column: " + catalog_col.fullName();

        // Multi-Column Partitioning
        if (catalog_col instanceof MultiColumn) {
            MultiColumn mc = (MultiColumn) catalog_col;
            if (debug.val)
                LOG.debug(catalog_tbl.getName() + " MultiColumn: " + mc);

            Object values[] = new Object[mc.size()];
            for (int i = 0; i < values.length; i++) {
                Column inner = mc.get(i);
                VoltType type = VoltType.get(inner.getType());
                values[i] = row.get(inner.getIndex(), type);
            } // FOR
            partition = this.hasher.multiValueHash(values);
View Full Code Here

                    if (target.isMarkedContainsOR()) {
                        if (debug.val)
                            LOG.warn("Trying to use multi-column partitioning [" + catalog_col.fullName() + "] on query that contains an 'OR': " + target);
                        table_partitions.addAll(this.all_partitions);
                    } else {
                        MultiColumn mc = (MultiColumn) catalog_col;
                        PartitionSet mc_partitions[] = this.mcPartitionSetPool.borrowObject();

                        if (trace.val)
                            LOG.trace("Calculating columns for multi-partition colunmn: " + mc);
                        boolean is_valid = true;
                        for (int i = 0, mc_cnt = mc.size(); i < mc_cnt; i++) {
                            Column mc_column = mc.get(i);
                            // assert(cache_entry.get(mc_column_key) != null) :
                            // "Null CacheEntry: " + mc_column_key;
                            if (target.predicates.containsKey(mc_column)) {
                                this.calculatePartitions(mc_partitions[i],
                                                         params,
                                                         target.is_array,
                                                         target.predicates.get(mc_column),
                                                         mc_column);
                            }

                            // Unless we have partition values for both keys,
                            // then it has to be a broadcast
                            if (mc_partitions[i].isEmpty()) {
                                if (debug.val)
                                    LOG.warn(String.format("No partitions for %s from %s. " +
                                         "Cache entry %s must be broadcast to all partitions",
                                         mc_column.fullName(), mc.fullName(), target));
                                table_partitions.addAll(this.all_partitions);
                                is_valid = false;
                                break;
                            }
                            if (trace.val)
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.