Skip to content

Commit c171170

Browse files
migraine-usermboehm7
authored andcommitted
[SYSTEMDS-3921] Initial join ordering rewrites
Closes #2424.
1 parent 1f2e2ea commit c171170

6 files changed

Lines changed: 765 additions & 2 deletions

File tree

scripts/builtin/raJoin.dml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
# A Matrix of left input data [shape: N x M]
2828
# colA Integer indicating the column index of matrix A to execute inner join command
2929
# B Matrix of right left data [shape: N x M]
30-
# colA Integer indicating the column index of matrix B to execute inner join command
30+
# colB Integer indicating the column index of matrix B to execute inner join command
3131
# method Join implementation method (nested-loop, sort-merge, hash, hash2)
3232
# ------------------------------------------------------------------------------
3333
#

src/main/java/org/apache/sysds/hops/OptimizerUtils.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ public enum MemoryManager {
302302
*/
303303
public static boolean ALLOW_TRANSITIVE_SPARK_EXEC_TYPE = true;
304304

305+
public static boolean ALLOW_JOIN_REORDERING_REWRITE = false;
305306
/**
306307
* Enable prefetch and broadcast. Prefetch asynchronously calls acquireReadAndRelease() to trigger remote
307308
* operations, which would otherwise make the next instruction wait till completion. Broadcast allows

src/main/java/org/apache/sysds/hops/rewrite/ProgramRewriter.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public ProgramRewriter(boolean staticRewrites, boolean dynamicRewrites)
7777
//add static HOP DAG rewrite rules
7878
_dagRuleSet.add( new RewriteRemoveReadAfterWrite() ); //dependency: before blocksize
7979
_dagRuleSet.add( new RewriteBlockSizeAndReblock() );
80+
8081
if( OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION )
8182
_dagRuleSet.add( new RewriteRemoveUnnecessaryCasts() );
8283
if( OptimizerUtils.ALLOW_COMMON_SUBEXPRESSION_ELIMINATION )
@@ -93,7 +94,6 @@ public ProgramRewriter(boolean staticRewrites, boolean dynamicRewrites)
9394
if( OptimizerUtils.ALLOW_QUANTIZE_COMPRESS_REWRITE )
9495
_dagRuleSet.add( new RewriteQuantizationFusedCompression() );
9596

96-
9797
//add statement block rewrite rules
9898
if( OptimizerUtils.ALLOW_BRANCH_REMOVAL )
9999
_sbRuleSet.add( new RewriteRemoveUnnecessaryBranches() ); //dependency: constant folding
@@ -119,6 +119,8 @@ public ProgramRewriter(boolean staticRewrites, boolean dynamicRewrites)
119119
_sbRuleSet.add( new MarkForLineageReuse() );
120120
_sbRuleSet.add( new RewriteRemoveTransformEncodeMeta() );
121121
_dagRuleSet.add( new RewriteNonScalarPrint() );
122+
if( OptimizerUtils.ALLOW_JOIN_REORDERING_REWRITE )
123+
_sbRuleSet.add( new RewriteJoinReordering() );
122124
}
123125

124126
// DYNAMIC REWRITES (which do require size information)

0 commit comments

Comments
 (0)