Skip to content

Commit

Permalink
Revert "Enhance join reordering to work with non-simple equi-join cla…
Browse files Browse the repository at this point in the history
…uses"

This reverts commit 009c06b.
  • Loading branch information
aaneja authored and ajaygeorge committed Sep 22, 2023
1 parent da04bac commit 55cc36f
Show file tree
Hide file tree
Showing 14 changed files with 77 additions and 642 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,6 @@ remote exchange (GATHER, SINGLE, [])
local exchange (GATHER, UNKNOWN, [])
remote exchange (REPARTITION, ROUND_ROBIN, [])
join (INNER, PARTITIONED):
remote exchange (REPARTITION, HASH, [subtract_400])
join (INNER, PARTITIONED):
final aggregation over (d_week_seq_232)
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, [d_week_seq_232])
partial aggregation over (d_week_seq_232)
join (INNER, REPLICATED):
remote exchange (REPARTITION, ROUND_ROBIN, [])
scan web_sales
scan catalog_sales
local exchange (GATHER, SINGLE, [])
remote exchange (REPLICATE, BROADCAST, [])
scan date_dim
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, [d_week_seq_316])
scan date_dim
join (INNER, PARTITIONED):
final aggregation over (d_week_seq)
local exchange (GATHER, SINGLE, [])
Expand All @@ -33,3 +17,20 @@ remote exchange (GATHER, SINGLE, [])
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, [d_week_seq_83])
scan date_dim
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, [subtract])
join (INNER, PARTITIONED):
final aggregation over (d_week_seq_232)
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, [d_week_seq_232])
partial aggregation over (d_week_seq_232)
join (INNER, REPLICATED):
remote exchange (REPARTITION, ROUND_ROBIN, [])
scan web_sales
scan catalog_sales
local exchange (GATHER, SINGLE, [])
remote exchange (REPLICATE, BROADCAST, [])
scan date_dim
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, [d_week_seq_316])
scan date_dim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
local exchange (GATHER, SINGLE, [])
remote exchange (GATHER, SINGLE, [])
join (INNER, PARTITIONED):
remote exchange (REPARTITION, HASH, [d_week_seq, d_week_seq_267, s_store_id])
remote exchange (REPARTITION, HASH, [d_week_seq, s_store_id])
join (INNER, REPLICATED):
join (INNER, REPLICATED):
final aggregation over (d_week_seq, ss_store_sk)
Expand All @@ -20,7 +20,7 @@ local exchange (GATHER, SINGLE, [])
remote exchange (REPLICATE, BROADCAST, [])
scan store
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, [d_week_seq_147, d_week_seq_63, s_store_id_235])
remote exchange (REPARTITION, HASH, [s_store_id_235, subtract])
join (INNER, REPLICATED):
join (INNER, REPLICATED):
final aggregation over (d_week_seq_147, ss_store_sk_127)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import com.facebook.presto.spi.relation.SpecialFormExpression;
import com.facebook.presto.spi.relation.SpecialFormExpression.Form;
import com.facebook.presto.spi.relation.VariableReferenceExpression;
import com.google.common.collect.ImmutableSet;

import java.util.ArrayDeque;
import java.util.ArrayList;
Expand Down Expand Up @@ -523,17 +522,6 @@ public ConvertNormalFormVisitorContext childContext()
}
}

private static class VariableReferenceBuilderVisitor
extends DefaultRowExpressionTraversalVisitor<ImmutableSet.Builder<VariableReferenceExpression>>
{
@Override
public Void visitVariableReference(VariableReferenceExpression variable, ImmutableSet.Builder<VariableReferenceExpression> builder)
{
builder.add(variable);
return null;
}
}

private class ConvertNormalFormVisitor
implements RowExpressionVisitor<RowExpression, ConvertNormalFormVisitorContext>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@ public final class SystemSessionProperties
public static final String PULL_EXPRESSION_FROM_LAMBDA_ENABLED = "pull_expression_from_lambda_enabled";
public static final String REWRITE_CONSTANT_ARRAY_CONTAINS_TO_IN_EXPRESSION = "rewrite_constant_array_contains_to_in_expression";
public static final String INFER_INEQUALITY_PREDICATES = "infer_inequality_predicates";
public static final String HANDLE_COMPLEX_EQUI_JOINS = "handle_complex_equi_joins";

// TODO: Native execution related session properties that are temporarily put here. They will be relocated in the future.
public static final String NATIVE_SIMPLIFIED_EXPRESSION_EVALUATION_ENABLED = "simplified_expression_evaluation_enabled";
Expand Down Expand Up @@ -1674,11 +1673,6 @@ public SystemSessionProperties(
INFER_INEQUALITY_PREDICATES,
"Infer nonequality predicates for joins",
featuresConfig.getInferInequalityPredicates(),
false),
booleanProperty(
HANDLE_COMPLEX_EQUI_JOINS,
"Handle complex equi-join conditions to open up join space for join reordering",
featuresConfig.getHandleComplexEquiJoins(),
false));
}

Expand Down Expand Up @@ -2827,9 +2821,4 @@ public static boolean shouldInferInequalityPredicates(Session session)
{
return session.getSystemProperty(INFER_INEQUALITY_PREDICATES, Boolean.class);
}

public static boolean shouldHandleComplexEquiJoins(Session session)
{
return session.getSystemProperty(HANDLE_COMPLEX_EQUI_JOINS, Boolean.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ public class FeaturesConfig
private boolean rewriteConstantArrayContainsToIn;

private boolean preProcessMetadataCalls;
private boolean handleComplexEquiJoins = true;

public enum PartitioningPrecisionStrategy
{
Expand Down Expand Up @@ -2740,17 +2739,4 @@ public FeaturesConfig setRewriteConstantArrayContainsToInEnabled(boolean rewrite
this.rewriteConstantArrayContainsToIn = rewriteConstantArrayContainsToIn;
return this;
}

public boolean getHandleComplexEquiJoins()
{
return handleComplexEquiJoins;
}

@Config("optimizer.handle-complex-equi-joins")
@ConfigDescription("Handle complex equi-join conditions to open up join space for join reordering")
public FeaturesConfig setHandleComplexEquiJoins(boolean handleComplexEquiJoins)
{
this.handleComplexEquiJoins = handleComplexEquiJoins;
return this;
}
}
Loading

0 comments on commit 55cc36f

Please sign in to comment.