Author: jolee
Date: 2014-04-22 10:11:47 -0400 (Tue, 22 Apr 2014)
New Revision: 4633
Modified:
branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/JoinNode.java
branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/MergeJoinStrategy.java
branches/7.7.x/test-integration/perf/src/test/java/org/teiid/query/eval/TestEnginePerformance.java
Log:
TEIID-2931: Perform equi-join full outer joins in a streaming manner
Modified:
branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/JoinNode.java
===================================================================
---
branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/JoinNode.java 2014-04-21
20:33:53 UTC (rev 4632)
+++
branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/JoinNode.java 2014-04-22
14:11:47 UTC (rev 4633)
@@ -179,7 +179,7 @@
TeiidProcessingException {
try {
if (state == State.LOAD_LEFT) {
- if (this.joinType != JoinType.JOIN_FULL_OUTER) {
+ if (this.joinType != JoinType.JOIN_FULL_OUTER || this.getJoinCriteria() ==
null) {
this.joinStrategy.leftSource.setImplicitBuffer(ImplicitBuffer.NONE);
}
//left child was already opened by the join node
Modified:
branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/MergeJoinStrategy.java
===================================================================
---
branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/MergeJoinStrategy.java 2014-04-21
20:33:53 UTC (rev 4632)
+++
branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/MergeJoinStrategy.java 2014-04-22
14:11:47 UTC (rev 4633)
@@ -212,7 +212,7 @@
outerMatched = false;
innerState.reset();
loopState = LoopState.LOAD_INNER;
- } else if (matchState == MatchState.MATCH_LEFT &&
joinNode.getJoinType() == JoinType.JOIN_FULL_OUTER) {
+ } else if (matchState == MatchState.MATCH_LEFT &&
joinNode.getJoinType() == JoinType.JOIN_FULL_OUTER &&
this.joinNode.getJoinCriteria() != null) {
// on a full outer join, we need to determine the outer right
values as well
matchState = MatchState.MATCH_RIGHT;
outerState = this.rightSource;
@@ -342,7 +342,7 @@
@Override
protected void loadRight() throws TeiidComponentException,
TeiidProcessingException {
- if (this.joinNode.getJoinType() != JoinType.JOIN_FULL_OUTER) {
+ if (this.joinNode.getJoinType() != JoinType.JOIN_FULL_OUTER ||
this.joinNode.getJoinCriteria() == null) {
this.rightSource.setImplicitBuffer(ImplicitBuffer.ON_MARK);
}
this.rightSource.sort(this.processingSortRight);
Modified:
branches/7.7.x/test-integration/perf/src/test/java/org/teiid/query/eval/TestEnginePerformance.java
===================================================================
---
branches/7.7.x/test-integration/perf/src/test/java/org/teiid/query/eval/TestEnginePerformance.java 2014-04-21
20:33:53 UTC (rev 4632)
+++
branches/7.7.x/test-integration/perf/src/test/java/org/teiid/query/eval/TestEnginePerformance.java 2014-04-22
14:11:47 UTC (rev 4633)
@@ -350,6 +350,10 @@
helpTestEquiJoin(bm, 100, 100, 10000, 1, new MergeJoinStrategy(SortOption.SORT,
SortOption.SORT, false), JoinType.JOIN_INNER, 100);
}
+ @Test public void runOuterMergeJoin_1_1000_1000() throws Exception {
+ helpTestEquiJoin(bm, 1000, 1000, 10000, 1, new MergeJoinStrategy(SortOption.SORT,
SortOption.SORT, false), JoinType.JOIN_FULL_OUTER, 1000);
+ }
+
@Test public void runInnerMergeJoin_4_4000_4000() throws Exception {
helpTestEquiJoin(bm, 4000, 4000, 500, 4, new MergeJoinStrategy(SortOption.SORT,
SortOption.SORT, false), JoinType.JOIN_INNER, 4000);
}
Show replies by date