Package com.foundationdb.sql.optimizer.rule.join_enum.DPhyp

Examples of com.foundationdb.sql.optimizer.rule.join_enum.DPhyp.JoinOperator


        }

        private List<JoinOperator> duplicateJoins(Collection<JoinOperator> joins) {
            List<JoinOperator> retJoins = new ArrayList<>();
            for (JoinOperator join : joins) {
                retJoins.add(new JoinOperator(join));
            }
            return retJoins;
        }
View Full Code Here


            // The code that follows has been extracted and simplified from
            // the processor.init() and processor.run() methods to handle the
            // one join case
            List<JoinOperator> operators = new ArrayList<>();
           
            JoinOperator op = new JoinOperator(joins);
            operators.add(op);
            long leftTable = JoinableBitSet.empty();
            long rightTable = JoinableBitSet.empty();
           
            if (joins.getLeft() instanceof TableGroupJoinTree) {
                leftTable = processor.getTableBit(joins.getLeft());
            }
            if (joins.getRight() instanceof TableGroupJoinTree) {
                rightTable = processor.getTableBit(joins.getRight());
            }
           
            ExpressionTables visitor = new ExpressionTables(processor.getTableBitSets());

            //protected void addWhereConditions(ConditionList whereConditions, ExpressionTables visitor) {           
            Iterator<ConditionExpression> iter = queryGoal.getWhereConditions().iterator();
            while (iter.hasNext()) {
                ConditionExpression condition = iter.next();
                if (condition instanceof ComparisonCondition) {
                    ComparisonCondition comp = (ComparisonCondition)condition;
                    long columnTables = columnReferenceTable(comp.getLeft(), processor.getTableBitSets());
                    if (!JoinableBitSet.isEmpty(columnTables)) {
                        long rhs = visitor.getTables(comp.getRight());
                        if (visitor.wasNullTolerant()) continue;
                        if (!JoinableBitSet.isEmpty(rhs) &&
                                !JoinableBitSet.overlaps(columnTables, rhs) &&
                                joins.getFKJoin().getConditions().contains(comp)) {
                            operators.add(new JoinOperator(comp, columnTables, rhs));
                            iter.remove();
                            continue;
                        }
                    }
                    columnTables = columnReferenceTable(comp.getRight(), processor.getTableBitSets());
                    if (!JoinableBitSet.isEmpty(columnTables)) {
                        long lhs = visitor.getTables(comp.getLeft());
                        if (visitor.wasNullTolerant()) continue;
                        if (!JoinableBitSet.isEmpty(lhs) &&
                                !JoinableBitSet.overlaps(columnTables, lhs) &&
                                joins.getFKJoin().getConditions().contains(comp)) {
                            operators.add(new JoinOperator(comp, columnTables, lhs));
                            iter.remove();
                            continue;
                        }
                    }
                }
View Full Code Here

TOP

Related Classes of com.foundationdb.sql.optimizer.rule.join_enum.DPhyp.JoinOperator

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.