Make PreferredProperties.mergeWithParent methods private
@@ -249,20 +249,6 @@ class PreferredProperties
return partitioningProperties;
}
- public Global mergeWithParent(Global parent, boolean mergePartitionPreference)
- {
- if (distributed != parent.distributed) {
- return this;
- }
- if (!partitioningProperties.isPresent()) {
- return parent;
- }
- if (!parent.partitioningProperties.isPresent() || !mergePartitionPreference) {
- return this;
- }
- return new Global(distributed, Optional.of(partitioningProperties.get().mergeWithParent(parent.partitioningProperties.get())));
- }
-
public Global translate(Function<VariableReferenceExpression, Optional<VariableReferenceExpression>> translator)
{
if (!isDistributed()) {
@@ -299,6 +285,20 @@ class PreferredProperties
.add("partitioningProperties", partitioningProperties)
.toString();
}
+
+ private Global mergeWithParent(Global parent, boolean mergePartitionPreference)
+ {
+ if (distributed != parent.distributed) {
+ return this;
+ }
+ if (!partitioningProperties.isPresent()) {
+ return parent;
+ }
+ if (!parent.partitioningProperties.isPresent() || !mergePartitionPreference) {
+ return this;
+ }
+ return new Global(distributed, Optional.of(partitioningProperties.get().mergeWithParent(parent.partitioningProperties.get())));
+ }
}
@Immutable
@@ -352,29 +352,6 @@ class PreferredProperties
return nullsAndAnyReplicated;
}
- public PartitioningProperties mergeWithParent(PartitioningProperties parent)
- {
- // Non-negotiable if we require a specific partitioning
- if (partitioning.isPresent()) {
- return this;
- }
-
- // Partitioning with different replication cannot be compared
- if (nullsAndAnyReplicated != parent.nullsAndAnyReplicated) {
- return this;
- }
-
- if (parent.partitioning.isPresent()) {
- // If the parent has a partitioning preference, propagate parent only if the parent's partitioning columns satisfies our preference.
- // Otherwise, ignore the parent since the parent will have to repartition anyways.
- return partitioningColumns.containsAll(parent.partitioningColumns) ? parent : this;
- }
-
- // Otherwise partition on any common columns if available
- Set<VariableReferenceExpression> common = Sets.intersection(partitioningColumns, parent.partitioningColumns);
- return common.isEmpty() ? this : partitioned(common).withNullsAndAnyReplicated(nullsAndAnyReplicated);
- }
-
public Optional<PartitioningProperties> translateVariable(Function<VariableReferenceExpression, Optional<VariableReferenceExpression>> translator)
{
Set<VariableReferenceExpression> newPartitioningColumns = partitioningColumns.stream()
@@ -430,5 +407,28 @@ class PreferredProperties
.add("nullsAndAnyReplicated", nullsAndAnyReplicated)
.toString();
}
+
+ private PartitioningProperties mergeWithParent(PartitioningProperties parent)
+ {
+ // Non-negotiable if we require a specific partitioning
+ if (partitioning.isPresent()) {
+ return this;
+ }
+
+ // Partitioning with different replication cannot be compared
+ if (nullsAndAnyReplicated != parent.nullsAndAnyReplicated) {
+ return this;
+ }
+
+ if (parent.partitioning.isPresent()) {
+ // If the parent has a partitioning preference, propagate parent only if the parent's partitioning columns satisfies our preference.
+ // Otherwise, ignore the parent since the parent will have to repartition anyways.
+ return partitioningColumns.containsAll(parent.partitioningColumns) ? parent : this;
+ }
+
+ // Otherwise partition on any common columns if available
+ Set<VariableReferenceExpression> common = Sets.intersection(partitioningColumns, parent.partitioningColumns);
+ return common.isEmpty() ? this : partitioned(common).withNullsAndAnyReplicated(nullsAndAnyReplicated);
+ }
}
}
