Package com.foundationdb.sql.optimizer.plan

Examples of com.foundationdb.sql.optimizer.plan.ColumnExpression


                    parentSource = generateTableSource(key.getReferencedTable());
                    sources.put(key.getReferencedTable(), parentSource);
                }
                checkFKParents (key.getReferencedTable(), parentSource, sources, equivelances);
                for (int i = 0; i < key.getReferencedColumns().size(); i++) {
                    ColumnExpression one = expressionFromColumn(key.getReferencingColumns().get(i), tableSource);
                    ColumnExpression two = expressionFromColumn(key.getReferencedColumns().get(i), parentSource);
                    equivelances.markEquivalent(one, two);
                }
            }
        }
    }
View Full Code Here


        if (source == null) {
            Table table = col.getTable();
            TableNode node = new TableNode(table, new TableTree());
            source = new TableSource(node, true, table.getName().toString());
        }
        return new ColumnExpression(source, col);
    }
View Full Code Here

                ComparisonCondition comparison = (ComparisonCondition) condition;
                if (comparison.getOperation().equals(Comparison.EQ)
                        && (comparison.getLeft() instanceof ColumnExpression)
                        && (comparison.getRight() instanceof ColumnExpression)
                        ) {
                    ColumnExpression left = (ColumnExpression) comparison.getLeft();
                    ColumnExpression right = (ColumnExpression) comparison.getRight();
                    if (!left.equals(right)) {
                        markNotNull(left);
                        markNotNull(right);
                        equivs.get().markEquivalent(left, right); // also implies right.equivalentTo(left)
                    }
View Full Code Here

            FunctionCondition condition = (FunctionCondition) node;
            if ("isNull".equals(condition.getFunction())) {
                if (condition.getOperands().size() == 1) {
                    ExpressionNode operand = condition.getOperands().get(0);
                    if (operand instanceof ColumnExpression) {
                        ColumnExpression operandColumn = (ColumnExpression) operand;
                        return new ColumnRanges(operandColumn, condition,
                                Collections.singletonList(RangeSegment.onlyNull(operandColumn)));
                    }
                }
            }
View Full Code Here

                        List<RangeSegment> segments) {
        this(columnExpression, Collections.singleton(rootCondition), segments);
    }

    private static ColumnRanges comparisonToRange(ComparisonCondition comparisonCondition) {
        final ColumnExpression columnExpression;
        final ExpressionNode other;
        final boolean columnIsRight;
        if (comparisonCondition.getLeft() instanceof ColumnExpression) {
            columnExpression = (ColumnExpression) comparisonCondition.getLeft();
            other = comparisonCondition.getRight();
View Full Code Here

            default:    throw new AssertionError(op.name());
        }
    }

    private static ColumnRanges inListToRange(InListCondition inListCondition) {
        final ColumnExpression columnExpression;
        if (inListCondition.getOperand() instanceof ColumnExpression) {
            columnExpression = (ColumnExpression)inListCondition.getOperand();
        }
        else {
            return null;
View Full Code Here

            for (Set<ColumnExpression> equivalentExpressions : set) {
                Iterator<ColumnExpression> equivalentIters = equivalentExpressions.iterator();
                boolean isInSet = areEquivalent(equivalentIters.next(), columnExpression, equivs);
                // as a sanity check, ensure that this is consistent for the rest of them
                while (equivalentIters.hasNext()) {
                    ColumnExpression next = equivalentIters.next();
                    boolean bothEquivalent = areEquivalent(next, columnExpression, equivs)
                            && areEquivalent(columnExpression, next, equivs);
                    assertEquals(
                            "equivalence for " + columnExpression + " against " + next + " in " + equivalentExpressions,
                            isInSet,
View Full Code Here

TOP

Related Classes of com.foundationdb.sql.optimizer.plan.ColumnExpression

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.