Package org.voltdb.planner

Examples of org.voltdb.planner.PlanColumn.guid()


        JSONArray outputColumns = obj.getJSONArray(Members.OUTPUT_COLUMNS.name());
        for (int ii = 0; ii < outputColumns.length(); ii++) {
            JSONObject jsonObject = outputColumns.getJSONObject(ii);
            PlanColumn column = PlanColumn.fromJSONObject(jsonObject, db);
            assert(column != null);
            node.m_outputColumns.add(column.guid());
//            System.err.println(String.format("[%02d] %s => %s", ii, node, column));
        }
       
        node.loadFromJSONObject(obj, db);
       
View Full Code Here


        try {
            JSONArray groupbyColumnGuids = obj.getJSONArray(Members.GROUPBY_COLUMNS.name());
            for (int ii = 0; ii < groupbyColumnGuids.length(); ii++) {
                JSONObject jsonObject = groupbyColumnGuids.getJSONObject(ii);
                PlanColumn column = PlanColumn.fromJSONObject(jsonObject, db);
                m_groupByColumnGuids.add(column.guid());
            }
        } catch (JSONException e) {
            //okay not to be there.
        }
    }
View Full Code Here

            int column_guid = guids.get(ctr);
            String name = "???";
            PlanColumn column = PlannerContext.singleton().get(column_guid);
            String inner = " : guid=" + column_guid;
            if (column != null) {
                assert (column_guid == column.guid());
                name = column.getDisplayName();
                inner += " : type=" + column.type() + " : size=" + column.width() + " : sort=" + column.getSortOrder() + " : storage=" + column.getStorage();
            }

            ret += String.format("%s   [%02d] %s%s\n", spacer, ctr, name, inner);
View Full Code Here

                AbstractExpression exp = planCol.getExpression();
                assert (exp != null);
                Collection<String> refTables = ExpressionUtil.getReferencedTableNames(exp);
                assert (refTables != null);
                if (refTables.size() == 1 && refTables.contains(PlanAssembler.AGGREGATE_TEMP_TABLE)) {
                    node.getAggregateColumnGuids().add(planCol.guid());
                }
            } // FOR
        }

        if (debug.val) {
View Full Code Here

                    exp.setColumnAlias("_DTXN_COUNT");
                    exp.setColumnIndex(clone_agg.getOutputColumnGUIDCount());
                    PlanColumn new_pc = state.plannerContext.getPlanColumn(exp, exp.getColumnAlias());
                    clone_agg.getAggregateOutputColumns().add(clone_agg.getOutputColumnGUIDCount());
                    clone_agg.getAggregateColumnNames().add(new_pc.getDisplayName());
                    clone_agg.getOutputColumnGUIDs().add(new_pc.guid());
                }
            }
        } // FOR
       
        // Now go through the original AggregateNode (the one at the top of tree)
View Full Code Here

            // they are trying to do
            // a sort on an aggregate output value...
            Pair<PlanColumn, Integer> p = findMatchingColumn(state, orig_pc, node.getOutputColumnGUIDs());
            PlanColumn new_pc = p.getFirst();
            assert (new_pc != null);
            node.getSortColumnGuids().set(i, new_pc.guid());
            // // XXX: Can we just loop through all our PlanColumns and find the
            // one we want?
            // if (new_pc == null) {
            // for (PlanColumn pc : state.plannerContext.getAllPlanColumns()) {
            // if (pc.equals(orig_pc, true, true)) {
View Full Code Here

            assert (p != null) : String.format("Failed to find %s's output %s from child node %s", node, orig_pc, child_node);
            PlanColumn new_pc = p.getFirst();
            assert (new_pc != null);
            if (debug.val)
                LOG.debug(String.format("[%02d] Setting %s GroupByColumnGuid to %s", i, node, new_pc));
            node.getGroupByColumnGuids().set(i, new_pc.guid());
        } // FOR

        for (int i = 0, cnt = node.getOutputColumnGUIDs().size(); i < cnt; i++) {
            Integer orig_guid = node.getOutputColumnGUIDs().get(i);
            PlanColumn orig_pc = state.plannerContext.get(orig_guid);
View Full Code Here

                Pair<PlanColumn, Integer> p = findMatchingColumn(state, orig_pc, child_node.getOutputColumnGUIDs());
                PlanColumn new_pc = p.getFirst();
                assert (new_pc != null);
                if (debug.val)
                    LOG.debug(String.format("[%02d] Setting %s OutputColumnGUID to %s", i, node, new_pc));
                node.getOutputColumnGUIDs().set(i, new_pc.guid());
            }
        } // FOR

        // System.err.println(this.sql);
        // System.err.println("AGGREGATE_OUTPUT_COLUMNS: " +
View Full Code Here

            // Always try make a new PlanColumn and update the
            // TupleValueExpresion index
            // This ensures that we always get the ordering correct
            PlanColumn new_col = state.plannerContext.getPlanColumn(new_exp, orig_pc.getDisplayName(), orig_pc.getSortOrder(), orig_pc.getStorage());
            assert (new_col != null);
            node.getOutputColumnGUIDs().set(i, new_col.guid());
        } // FOR
        state.markDirty(node);
        if (debug.val)
            LOG.debug(String.format("Updated %s with %d output columns offsets", node, node.getOutputColumnGUIDCount()));
        return (true);
View Full Code Here

                new_exp.setColumnIndex(i);
                new_exp.setColumnAlias(orig_pc.getDisplayName());
                new_exp.setValueType(VoltType.STRING);
                PlanColumn new_col = state.plannerContext.getPlanColumn(new_exp, orig_pc.getDisplayName(), orig_pc.getSortOrder(), orig_pc.getStorage());
                assert (new_col != null);
                node.getOutputColumnGUIDs().set(i, new_col.guid());
            } else {
                // Always try make a new PlanColumn and update the
                // TupleValueExpresion index
                // This ensures that we always get the ordering correct
                TupleValueExpression orig_exp = (TupleValueExpression) orig_pc.getExpression();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.