use of com.facebook.presto.sql.planner.optimizations.StreamPropertyDerivations.StreamProperties in project presto by prestodb.
the class RuntimeReorderJoinSides method checkBuildSidePropertySatisfied.
// Check if the property of a planNode satisfies the requirements for directly feeding as the build side of a JoinNode.
private boolean checkBuildSidePropertySatisfied(PlanNode node, List<VariableReferenceExpression> partitioningColumns, Context context) {
StreamPreferredProperties requiredBuildProperty;
if (getTaskConcurrency(context.getSession()) > 1) {
requiredBuildProperty = exactlyPartitionedOn(partitioningColumns);
} else {
requiredBuildProperty = singleStream();
}
StreamProperties nodeProperty = derivePropertiesRecursively(node, metadata, parser, context);
return requiredBuildProperty.isSatisfiedBy(nodeProperty);
}
use of com.facebook.presto.sql.planner.optimizations.StreamPropertyDerivations.StreamProperties in project presto by prestodb.
the class RuntimeReorderJoinSides method derivePropertiesRecursively.
private StreamProperties derivePropertiesRecursively(PlanNode node, Metadata metadata, SqlParser parser, Context context) {
PlanNode actual = context.getLookup().resolve(node);
List<StreamProperties> inputProperties = actual.getSources().stream().map(source -> derivePropertiesRecursively(source, metadata, parser, context)).collect(toImmutableList());
return StreamPropertyDerivations.deriveProperties(actual, inputProperties, metadata, context.getSession(), context.getVariableAllocator().getTypes(), parser);
}
use of com.facebook.presto.sql.planner.optimizations.StreamPropertyDerivations.StreamProperties in project presto by prestodb.
the class RuntimeReorderJoinSides method checkProbeSidePropertySatisfied.
// Check if the new probe side after removing unnecessary local exchange is valid.
private boolean checkProbeSidePropertySatisfied(PlanNode node, Context context) {
StreamPreferredProperties requiredProbeProperty;
if (isSpillEnabled(context.getSession()) && isJoinSpillingEnabled(context.getSession())) {
requiredProbeProperty = fixedParallelism();
} else {
requiredProbeProperty = defaultParallelism(context.getSession());
}
StreamProperties nodeProperty = derivePropertiesRecursively(node, metadata, parser, context);
return requiredProbeProperty.isSatisfiedBy(nodeProperty);
}
Aggregations