Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@ 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 @@ -17,20 +33,3 @@ 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, s_store_id])
remote exchange (REPARTITION, HASH, [d_week_seq, d_week_seq_267, 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, [s_store_id_235, subtract])
remote exchange (REPARTITION, HASH, [d_week_seq_147, d_week_seq_63, s_store_id_235])
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,6 +26,7 @@
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 @@ -522,6 +523,17 @@ 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,6 +287,7 @@ 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 @@ -1673,6 +1674,11 @@ 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 @@ -2821,4 +2827,9 @@ 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 @@ -278,6 +278,7 @@ public class FeaturesConfig
private boolean rewriteConstantArrayContainsToIn;

private boolean preProcessMetadataCalls;
private boolean handleComplexEquiJoins = true;

public enum PartitioningPrecisionStrategy
{
Expand Down Expand Up @@ -2751,4 +2752,17 @@ 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