private static SourceImpl buildJoin(SourceImpl result, SourceImpl last, List<JoinConditionImpl> conditions) { if (result == null) { return last; } List<SourceImpl> selectors = result.getInnerJoinSelectors(); Set<SourceImpl> oldSelectors = new HashSet<SourceImpl>(); oldSelectors.addAll(selectors); Set<SourceImpl> newSelectors = new HashSet<SourceImpl>(); newSelectors.addAll(selectors); newSelectors.add(last); for (JoinConditionImpl j : conditions) { // only join conditions can now be evaluated, // but couldn't be evaluated before if (!j.canEvaluate(oldSelectors) && j.canEvaluate(newSelectors)) { JoinImpl join = new JoinImpl(result, last, JoinType.INNER, j); return join; } } // no join condition was found return null; }
private static SourceImpl buildJoin(SourceImpl result, SourceImpl last, List<JoinConditionImpl> conditions) { if (result == null) { return last; } List<SourceImpl> selectors = result.getInnerJoinSelectors(); Set<SourceImpl> oldSelectors = new HashSet<SourceImpl>(); oldSelectors.addAll(selectors); Set<SourceImpl> newSelectors = new HashSet<SourceImpl>(); newSelectors.addAll(selectors); newSelectors.add(last); for (JoinConditionImpl j : conditions) { // only join conditions can now be evaluated, // but couldn't be evaluated before if (!j.canEvaluate(oldSelectors) && j.canEvaluate(newSelectors)) { JoinImpl join = new JoinImpl(result, last, JoinType.INNER, j); return join; } } // no join condition was found return null; }
private static SourceImpl buildJoin(SourceImpl result, SourceImpl last, List<JoinConditionImpl> conditions) { if (result == null) { return last; } List<SourceImpl> selectors = result.getInnerJoinSelectors(); Set<SourceImpl> oldSelectors = new HashSet<SourceImpl>(); oldSelectors.addAll(selectors); Set<SourceImpl> newSelectors = new HashSet<SourceImpl>(); newSelectors.addAll(selectors); newSelectors.add(last); for (JoinConditionImpl j : conditions) { // only join conditions can now be evaluated, // but couldn't be evaluated before if (!j.canEvaluate(oldSelectors) && j.canEvaluate(newSelectors)) { JoinImpl join = new JoinImpl(result, last, JoinType.INNER, j); return join; } } // no join condition was found return null; }