helpCreateJoin(); this.joinStrategy = new EnhancedSortMergeJoinStrategy(SortOption.SORT, SortOption.SORT); this.join.setJoinStrategy(joinStrategy); helpTestJoinDirect(expected, batchSize, 1);
helpCreateJoin(); this.joinStrategy = new EnhancedSortMergeJoinStrategy(SortOption.SORT, SortOption.ALREADY_SORTED); this.join.setJoinStrategy(joinStrategy); helpTestJoinDirect(expected, 40, 1);
EnhancedSortMergeJoinStrategy esmjs = new EnhancedSortMergeJoinStrategy(SortOption.NOT_SORTED, SortOption.SORT); this.joinStrategy = esmjs; this.join.setJoinStrategy(joinStrategy);
helpCreateJoin(); this.joinStrategy = new EnhancedSortMergeJoinStrategy(SortOption.SORT, SortOption.SORT); this.join.setJoinStrategy(joinStrategy);
EnhancedSortMergeJoinStrategy esmjs = new EnhancedSortMergeJoinStrategy(SortOption.NOT_SORTED, SortOption.SORT); this.joinStrategy = esmjs; this.join.setJoinStrategy(joinStrategy);
psj.setPreferMemCutoff(1); this.joinStrategy = psj; this.join.setJoinStrategy(joinStrategy); helpTestJoinDirect(expected, 4, 1000);
rightNode = newNode; this.join.setJoinStrategy(joinStrategy); helpTestJoinDirect(expected, 5, 1);
@Test public void testMergeJoinAlreadySortedWithNulls() throws Exception { this.joinType = JoinType.JOIN_INNER; this.leftTuples = new List[] { Collections.singletonList(null), Arrays.asList(1), Arrays.asList(2), }; this.rightTuples = new List[] { Arrays.asList(1), Arrays.asList(2), Collections.singletonList(null), }; expected = new List[] { Arrays.asList(new Object[] { 1, 1 }), Arrays.asList(new Object[] { 2, 2 }), }; helpCreateJoin(); this.joinStrategy = new EnhancedSortMergeJoinStrategy(SortOption.ALREADY_SORTED, SortOption.ALREADY_SORTED); this.join.setJoinStrategy(joinStrategy); helpTestJoinDirect(expected, 40, 100000); List[] temp = leftTuples; leftTuples = rightTuples; rightTuples = temp; helpCreateJoin(); helpTestJoinDirect(expected, 40, 100000); }
@Test public void testMergeJoinOptimizationNoRows() throws Exception { this.joinType = JoinType.JOIN_INNER; this.leftTuples = createTuples1(); this.rightTuples = new List[] {}; expected = new List[] {}; helpCreateJoin(); this.joinStrategy = new EnhancedSortMergeJoinStrategy(SortOption.SORT, SortOption.SORT); this.join.setJoinStrategy(joinStrategy); helpTestJoinDirect(expected, 100, 1); }
join.setJoinStrategy(joinStrategy);
join.setJoinType(joinType); join.setJoinExpressions(Arrays.asList(es1, es1, es2), Arrays.asList(es3, es4, es5)); join.setJoinStrategy(joinStrategy); this.joinStrategy = new EnhancedSortMergeJoinStrategy(SortOption.SORT, SortOption.SORT); this.join.setJoinStrategy(joinStrategy); helpTestJoinDirect(expected, 10, 1);
join.setJoinStrategy(joinStrategy); join.setElements(joinElements); join.setJoinType(joinType); join.setJoinExpressions(Arrays.asList(es1), Arrays.asList(es2)); joinStrategy = new MergeJoinStrategy(SortOption.SORT, SortOption.SORT, false); join.setJoinStrategy(joinStrategy); break;
mjStrategy = new MergeJoinStrategy(leftSort, (SortOption)node.getProperty(NodeConstants.Info.SORT_RIGHT), false); jnode.setJoinStrategy(mjStrategy); List leftExpressions = (List) node.getProperty(NodeConstants.Info.LEFT_EXPRESSIONS); List rightExpressions = (List) node.getProperty(NodeConstants.Info.RIGHT_EXPRESSIONS); } else if (stype == JoinStrategyType.NESTED_TABLE) { NestedTableJoinStrategy ntjStrategy = new NestedTableJoinStrategy(); jnode.setJoinStrategy(ntjStrategy); SymbolMap references = (SymbolMap)node.getProperty(Info.LEFT_NESTED_REFERENCES); ntjStrategy.setLeftMap(references); } else { NestedLoopJoinStrategy nljStrategy = new NestedLoopJoinStrategy(); jnode.setJoinStrategy(nljStrategy); joinAsSet.setJoinStrategy(new MergeJoinStrategy(SortOption.SORT_DISTINCT, SortOption.SORT_DISTINCT, true));
mjStrategy.singleMatch(true); jnode.setJoinStrategy(mjStrategy); List leftExpressions = (List) node.getProperty(NodeConstants.Info.LEFT_EXPRESSIONS); List rightExpressions = (List) node.getProperty(NodeConstants.Info.RIGHT_EXPRESSIONS); } else if (stype == JoinStrategyType.NESTED_TABLE) { NestedTableJoinStrategy ntjStrategy = new NestedTableJoinStrategy(); jnode.setJoinStrategy(ntjStrategy); SymbolMap references = (SymbolMap)node.getProperty(Info.RIGHT_NESTED_REFERENCES); ntjStrategy.setRightMap(references); } else { NestedLoopJoinStrategy nljStrategy = new NestedLoopJoinStrategy(); jnode.setJoinStrategy(nljStrategy); joinAsSet.setJoinStrategy(new MergeJoinStrategy(SortOption.SORT_DISTINCT, SortOption.SORT_DISTINCT, true));
mjStrategy.singleMatch(true); jnode.setJoinStrategy(mjStrategy); List leftExpressions = (List) node.getProperty(NodeConstants.Info.LEFT_EXPRESSIONS); List rightExpressions = (List) node.getProperty(NodeConstants.Info.RIGHT_EXPRESSIONS); } else if (stype == JoinStrategyType.NESTED_TABLE) { NestedTableJoinStrategy ntjStrategy = new NestedTableJoinStrategy(); jnode.setJoinStrategy(ntjStrategy); SymbolMap references = (SymbolMap)node.getProperty(Info.RIGHT_NESTED_REFERENCES); ntjStrategy.setRightMap(references); } else { NestedLoopJoinStrategy nljStrategy = new NestedLoopJoinStrategy(); jnode.setJoinStrategy(nljStrategy); joinAsSet.setJoinStrategy(new MergeJoinStrategy(SortOption.SORT_DISTINCT, SortOption.SORT_DISTINCT, true));