Package com.foundationdb.sql.optimizer.rule.ExpressionAssembler

Examples of com.foundationdb.sql.optimizer.rule.ExpressionAssembler.ColumnExpressionToIndex


            RowStream stream = assembleQuery(updateInput.getInput());
            TableSource table = updateInput.getTable();
            TableRowType rowType = tableRowType(table);
            if ((stream.rowType != rowType) ||
                !boundRowIsForTable(stream.fieldOffsets, table)) {
                ColumnExpressionToIndex boundRow = lookupNestedBoundRow(table);
                stream.operator = API.emitBoundRow_Nested(stream.operator,
                                                          stream.rowType,
                                                          rowType,
                                                          boundRow.getRowType(),
                                                          getBindingPosition(boundRow));
                stream.rowType = rowType;
                stream.fieldOffsets = new ColumnSourceFieldOffsets(table, stream.rowType);
            }
            return stream;
View Full Code Here


        protected RowStream assembleSelect(Select select) {
            RowStream stream = assembleStream(select.getInput());
            ConditionDependencyAnalyzer dependencies = null;
            for (ConditionExpression condition : select.getConditions()) {
                RowType rowType = stream.rowType;
                ColumnExpressionToIndex fieldOffsets = stream.fieldOffsets;
                if (rowType == null) {
                    // Pre-flattening case: get the single table this
                    // condition must have come from and use its row-type.
                    // TODO: Would it be better if earlier rule saved this?
                    if (dependencies == null)
View Full Code Here

                outputRowTypes.add(tableRowType(table));
            }
            PlanNode input = ancestorLookup.getInput();
            if (input instanceof GroupLoopScan) {
                stream = new RowStream();
                ColumnExpressionToIndex boundRow = lookupNestedBoundRow(((GroupLoopScan)ancestorLookup.getInput()));
                stream.operator = API.ancestorLookup_Nested(group,
                                                            boundRow.getRowType(),
                                                            outputRowTypes,
                                                            getBindingPosition(boundRow),
                                                            rulesContext.getPipelineConfiguration().getGroupLookupLookaheadQuantum());
            }
            else {
View Full Code Here

            }
            if (branchLookup.getInput() == null) {
                // Simple version for Product_Nested.
                stream = new RowStream();
                API.InputPreservationOption flag = API.InputPreservationOption.KEEP_INPUT;
                ColumnExpressionToIndex boundRow = boundRows.peek();
                stream.operator = API.branchLookup_Nested(group,
                                                          boundRow.getRowType(),
                                                          tableRowType(branchLookup.getSource()),
                                                          tableRowType(branchLookup.getAncestor()),
                                                          outputRowTypes,
                                                          flag,
                                                          getBindingPosition(boundRow),
                                                          rulesContext.getPipelineConfiguration().getGroupLookupLookaheadQuantum());
               
            }
            else if (branchLookup.getInput() instanceof GroupLoopScan) {
                // Fuller version for group join across subquery boundary.
                stream = new RowStream();
                API.InputPreservationOption flag = API.InputPreservationOption.DISCARD_INPUT;
                ColumnExpressionToIndex boundRow = lookupNestedBoundRow(((GroupLoopScan)branchLookup.getInput()));
                stream.operator = API.branchLookup_Nested(group,
                                                          boundRow.getRowType(),
                                                          boundRow.getRowType(),
                                                          tableRowType(branchLookup.getAncestor()),
                                                          outputRowTypes,
                                                          flag,
                                                          getBindingPosition(boundRow),
                                                          rulesContext.getPipelineConfiguration().getGroupLookupLookaheadQuantum());
View Full Code Here

            return result;
        }

        @Override
        public TPreparedExpression assembleSubqueryExpression(SubqueryExpression sexpr) {
            ColumnExpressionToIndex fieldOffsets = columnBoundRows.current;
            RowType outerRowType = null;
            if (fieldOffsets != null)
                outerRowType = fieldOffsets.getRowType();
            int pos = pushBoundRow(fieldOffsets);
            PlanNode subquery = sexpr.getSubquery().getQuery();
            ExpressionNode expression = null;
            boolean fieldExpression = false;
            if ((sexpr instanceof AnyCondition) ||
View Full Code Here

TOP

Related Classes of com.foundationdb.sql.optimizer.rule.ExpressionAssembler.ColumnExpressionToIndex

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.