Package org.voltdb.catalog

Examples of org.voltdb.catalog.Column


        StmtParameter catalog_stmt_param = c.getStmtParameter();
        assert(catalog_stmt_param != null);
        Procedure catalog_proc = catalog_stmt.getParent();
        assert(catalog_proc != null);
        ProcParameter catalog_proc_param = c.getProcParameter();
        Column catalog_col = c.getColumn();
       
        // Procedure Index
        if (!this.procIndex.containsKey(catalog_proc)) {
            this.procIndex.put(catalog_proc, new ProcedureMappings());
        }
View Full Code Here


                    // Special Case: MultiColumn
                } else if (child_key.startsWith(MultiColumn.PREFIX)) {
                    int prefix_offset = MultiColumn.PREFIX.length() + MULTIATTRIBUTE_DELIMITER.length();
                    String names[] = child_key.substring(prefix_offset).split(MULTIATTRIBUTE_DELIMITER);
                    assert (names.length > 1) : "Invalid MultiColumn Key: " + child_key;
                    Column params[] = new Column[names.length];
                    for (int i = 0; i < names.length; i++) {
                        params[i] = getFromKey(catalog_db, createKey(parent_key, names[i]), Column.class);
                    } // FOR
                    catalog_child = (T) MultiColumn.get(params);
View Full Code Here

                            return;
                        }

                        Collection<Column> columns = ExpressionUtil.getReferencedColumns(state.catalog_db, col_exp);
                        assert (columns.size() == 1);
                        Column catalog_col = CollectionUtil.first(columns);
                        if (catalog_col.getIndex() != i) {
                            return;
                        }
                    } // FOR

                    // If we're here, the new know that we can remove the
View Full Code Here

     * @return
     */
    public static Column getForeignKeyParent(Column from_column) {
        assert (from_column != null);
        final CatalogUtil.Cache cache = CatalogUtil.getCatalogCache(from_column);
        Column to_column = cache.FOREIGNKEY_PARENT.get(from_column);

        if (to_column == null) {
            for (Constraint catalog_const : CatalogUtil.getConstraints(from_column.getConstraints())) {
                if (catalog_const.getType() == ConstraintType.FOREIGN_KEY.getValue()) {
                    assert (!catalog_const.getForeignkeycols().isEmpty());
View Full Code Here

        List<String> found= new ArrayList<String>();
        CatalogMap<Column> columns = catalog_tbl.getColumns();
        for (Table t : catalog_db.getTables()){
          if(t!=catalog_tbl){
            for(Column c: getForeignKeyDependents(t)){
              Column parentColumn = CatalogUtil.getForeignKeyParent(c);
              if(columns.containsKey(parentColumn.getName())){
                found.add(t.getName());
                break;
              }
            }
          }
View Full Code Here

     */
    public static Collection<Column> getColumns(Iterable<ColumnRef> map) {
        List<Column> ret = new ArrayList<Column>();
        if (map != null) {
            for (ColumnRef ref : map) {
                Column catalog_item = ref.getColumn();
                assert (catalog_item != null);
                ret.add(catalog_item);
            }
        }
        return (ret);
View Full Code Here

     * @param table_name
     * @param column_name
     * @return
     */
    public static Column getColumn(Database catalog_db, String table_name, String column_name) {
        Column catalog_col = null;
        Table catalog_table = catalog_db.getTables().get(table_name);
        if (catalog_table != null)
            catalog_col = catalog_table.getColumns().get(column_name);
        return (catalog_col);
    }
View Full Code Here

                        PlanColumn pc = pcontext.get(col_guid);
                        assert (pc != null);
                        if (pc.getExpression() instanceof TupleAddressExpression)
                            continue;

                        Column catalog_col = catalog_tbl.getColumns().get(pc.getDisplayName());
                        if (catalog_col == null) {
                            LOG.error("Invalid PlanNode:\n" + PlanNodeUtil.debug(up_node));
                        }
                        assert (catalog_col != null) : String.format("Missing %s.%s\n%s", catalog_tbl.getName(), pc.getDisplayName(), pc);
View Full Code Here

            }
           
            CatalogType ctypes[] = { cp.getFirst(), cp.getSecond() };
            for (int i = 0; i < ctypes.length; i++) {
                if (ctypes[i] instanceof Column) {
                    Column target_col = (Column)ctypes[i];
                    Table target_tbl = target_col.getParent();

                    // Find what index it's using
                    // This is a rough approximation...
                    Index target_idx = null;
                    for (Index idx : indexes) {
View Full Code Here

                    // "PARAM1 + PARAM2", then
                    // the column set will have separate entries for FOO->PARAM1
                    // and FOO->PARAM2
                    LOG.debug("Materialize Elements: " + materialize_elements);
                    for (int ctr = 0, cnt = materialize_elements.size(); ctr < cnt; ctr++) {
                        Column catalog_col = catalog_tbl.getColumns().get(ctr);
                        assert (catalog_col != null);
                        for (CatalogType catalog_item : materialize_elements.get(ctr)) {
                            cset.add(catalog_col, catalog_item, ExpressionType.COMPARE_EQUAL, catalog_stmt);
                            LOG.debug(String.format("[%02d] Adding Entry %s => %s", ctr, catalog_col, catalog_item));
                        } // FOR
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.