Package org.voltdb.plannodes

Examples of org.voltdb.plannodes.ProjectionPlanNode


        // generate the delete node with the right target table
        DeletePlanNode deleteNode = new DeletePlanNode(m_context, getNextPlanNodeId());
        deleteNode.setTargetTableName(targetTable.getTypeName());

        ProjectionPlanNode projectionNode = new ProjectionPlanNode(m_context, getNextPlanNodeId());
        AbstractExpression addressExpr = new TupleAddressExpression();
        PlanColumn colInfo = m_context.getPlanColumn(addressExpr, "tuple_address");
        projectionNode.appendOutputColumn(colInfo);

        if (m_singlePartition == true) {

            assert(subSelectRoot instanceof AbstractScanPlanNode);
View Full Code Here


        UpdatePlanNode updateNode = new UpdatePlanNode(m_context, getNextPlanNodeId());
        updateNode.setTargetTableName(targetTable.getTypeName());
        // set this to false until proven otherwise
        updateNode.setUpdateIndexes(false);

        ProjectionPlanNode projectionNode = new ProjectionPlanNode(m_context, getNextPlanNodeId());
        TupleAddressExpression tae = new TupleAddressExpression();
        PlanColumn colInfo = m_context.getPlanColumn(tae, "tuple_address");
        projectionNode.appendOutputColumn(colInfo);

        // get the set of columns affected by indexes
        Set<String> affectedColumns = getIndexedColumnSetForTable(targetTable);

        // add the output columns we need
        for (Entry<Column, AbstractExpression> col : m_parsedUpdate.columns.entrySet()) {
            colInfo = m_context.getPlanColumn(col.getValue(), col.getKey().getTypeName());
            projectionNode.appendOutputColumn(colInfo);

            // check if this column is an indexed column
            if (affectedColumns.contains(colInfo.getDisplayName()))
                updateNode.setUpdateIndexes(true);
        }
View Full Code Here

        PlanColumn colInfo = null;

        // The rootNode must have a correct output column set.
        rootNode.updateOutputColumns(m_catalogDb);

        ProjectionPlanNode projectionNode =
            new ProjectionPlanNode(m_context, PlanAssembler.getNextPlanNodeId());

        // The input to this projection MUST include all the columns needed
        // to satisfy any TupleValueExpression in the parsed select statement's
        // output expressions.
        //
        // For each parsed select statement output column, create a new PlanColumn
        // cloning the expression. Walk the clone and configure each TVE with
        // the offset into the input column array.
        for (ParsedSelectStmt.ParsedColInfo outputCol : m_parsedSelect.displayColumns) {
            assert(outputCol.expression != null);
            try {
                AbstractExpression expressionWithRealOffsets =
                    generateProjectionColumnExpression(outputCol,
                                                     rootNode.getOutputColumnGUIDs());
                colInfo = m_context.getPlanColumn(expressionWithRealOffsets, outputCol.alias);
                projectionNode.appendOutputColumn(colInfo);
            } catch (CloneNotSupportedException ex) {
                throw new PlanningErrorException(ex.getMessage());
            }
        }

        // if the projection can be done inline...
        if (rootNode instanceof AbstractScanPlanNode) {
            rootNode.addInlinePlanNode(projectionNode);
            return rootNode;
        } else {
            projectionNode.addAndLinkChild(rootNode);
            return projectionNode;
        }
    }
View Full Code Here

                reAggType = ExpressionType.AGGREGATE_SUM;
            }
            mvColumnReAggType.put(mvCol.getName(), reAggType);
        }

        m_scanInlinedProjectionNode = new ProjectionPlanNode();
        m_scanInlinedProjectionNode.setOutputSchema(inlineProjSchema);

        // (2) Construct the reAggregation Node.

        // Construct the reAggregation plan node's aggSchema
View Full Code Here

        // generate the delete node with the right target table
        DeletePlanNode deleteNode = new DeletePlanNode();
        deleteNode.setTargetTableName(targetTable.getTypeName());

        ProjectionPlanNode projectionNode = new ProjectionPlanNode();
        AbstractExpression addressExpr = new TupleAddressExpression();
        NodeSchema proj_schema = new NodeSchema();
        // This planner-created column is magic.
        proj_schema.addColumn(new SchemaColumn("VOLT_TEMP_TABLE",
                                               "VOLT_TEMP_TABLE",
                                               "tuple_address",
                                               "tuple_address",
                                               addressExpr));
        projectionNode.setOutputSchema(proj_schema);

        assert(subSelectRoot instanceof AbstractScanPlanNode);

        // If the scan matches all rows, we can throw away the scan
        // nodes and use a truncate delete node.
View Full Code Here

        Table targetTable = m_parsedUpdate.m_tableList.get(0);
        updateNode.setTargetTableName(targetTable.getTypeName());
        // set this to false until proven otherwise
        updateNode.setUpdateIndexes(false);

        ProjectionPlanNode projectionNode = new ProjectionPlanNode();
        TupleAddressExpression tae = new TupleAddressExpression();
        NodeSchema proj_schema = new NodeSchema();
        // This planner-generated column is magic.
        proj_schema.addColumn(new SchemaColumn("VOLT_TEMP_TABLE",
                                               "VOLT_TEMP_TABLE",
                                               "tuple_address",
                                               "tuple_address",
                                               tae));

        // get the set of columns affected by indexes
        Set<String> affectedColumns = getIndexedColumnSetForTable(targetTable);

        // add the output columns we need to the projection
        //
        // Right now, the EE is going to use the original column names
        // and compare these to the persistent table column names in the
        // update executor in order to figure out which table columns get
        // updated.  We'll associate the actual values with VOLT_TEMP_TABLE
        // to avoid any false schema/column matches with the actual table.
        for (Entry<Column, AbstractExpression> col : m_parsedUpdate.columns.entrySet()) {
            String tableName = col.getKey().getTypeName();
            AbstractExpression expr = col.getValue();
            expr.setInBytes(col.getKey().getInbytes());

            proj_schema.addColumn(new SchemaColumn("VOLT_TEMP_TABLE",
                                                   "VOLT_TEMP_TABLE",
                                                   tableName,
                                                   tableName,
                                                   expr));

            // check if this column is an indexed column
            if (affectedColumns.contains(col.getKey().getTypeName()))
            {
                updateNode.setUpdateIndexes(true);
            }
        }
        projectionNode.setOutputSchema(proj_schema);


        // add the projection inline (TODO: this will break if more than one
        // layer is below this)
        //
View Full Code Here

     */
    AbstractPlanNode addProjection(AbstractPlanNode rootNode) {
        assert (m_parsedSelect != null);
        assert (m_parsedSelect.m_displayColumns != null);

        ProjectionPlanNode projectionNode =
            new ProjectionPlanNode();

        // Build the output schema for the projection based on the display columns
        NodeSchema proj_schema = m_parsedSelect.getFinalProjectionSchema();
        projectionNode.setOutputSchemaWithoutClone(proj_schema);

        // if the projection can be done inline...
        if (rootNode instanceof AbstractScanPlanNode) {
            rootNode.addInlinePlanNode(projectionNode);
            return rootNode;
        } else {
            projectionNode.addAndLinkChild(rootNode);
            return projectionNode;
        }
    }
View Full Code Here

            // Set post predicate for final distributed Aggregation node
            distNode.setPostPredicate(m_parsedSelect.m_having);
        }

        if (selectStmt.hasComplexAgg()) {
            ProjectionPlanNode proj = new ProjectionPlanNode();
            proj.addAndLinkChild(root);
            proj.setOutputSchema(selectStmt.getFinalProjectionSchema());
            root = proj;
        }
        return root;
    }
View Full Code Here

TOP

Related Classes of org.voltdb.plannodes.ProjectionPlanNode

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.