Source:
<code>public ExchangeNode( @JsonProperty("id") PlanNodeId id, @JsonProperty("type") Type type, @JsonProperty("scope") Scope scope, @JsonProperty("partitioningScheme") PartitioningScheme partitioningScheme, @JsonProperty("sources") List<PlanNode> sources, @JsonProperty("inputs") List<List<Symbol>> inputs, @JsonProperty("orderingScheme") Optional<OrderingScheme> orderingScheme) { super(id); requireNonNull(type, "type is null"); requireNonNull(scope, "scope is null"); requireNonNull(sources, "sources is null"); requireNonNull(partitioningScheme, "partitioningScheme is null"); requireNonNull(inputs, "inputs is null"); requireNonNull(orderingScheme, "orderingScheme is null"); checkArgument(!inputs.isEmpty(), "inputs is empty"); checkArgument(inputs.stream().allMatch(inputSymbols -> inputSymbols.size() == partitioningScheme.getOutputLayout().size()), "Input symbols do not match output symbols"); checkArgument(inputs.size() == sources.size(), "Must have same number of input lists as sources"); for (int i = 0; i < inputs.size(); i++) { checkArgument(sources.get(i).getOutputSymbols().containsAll(inputs.get(i)), "Source does not supply all required input symbols"); } checkArgument(scope != LOCAL || partitioningScheme.getPartitioning().getArguments().stream().allMatch(ArgumentBinding::isVariable), "local exchanges do not support constant partition function arguments"); checkArgument(scope != REMOTE || type == Type.REPARTITION || !partitioningScheme.isReplicateNullsAndAny(), "Only REPARTITION can replicate remotely"); <START> checkArgument(type == Type.GATHER || !orderingScheme.isPresent(), "ordering scheme can be set only for GATHERING"); <END> this.type = type; this.sources = sources; this.scope = scope; this.partitioningScheme = partitioningScheme; this.inputs = listOfListsCopy(inputs); this.orderingScheme = orderingScheme; }</code><technical_language>Do PartitioningScheme allows for orderingScheme present type=GATHER</technical_language>

Target:
public ExchangeNode( @JsonProperty("id") PlanNodeId id, @JsonProperty("type") Type type, @JsonProperty("scope") Scope scope, @JsonProperty("partitioningScheme") PartitioningScheme partitioningScheme, @JsonProperty("sources") List<PlanNode> sources, @JsonProperty("inputs") List<List<Symbol>> inputs, @JsonProperty("orderingScheme") Optional<OrderingScheme> orderingScheme) { super(id); requireNonNull(type, "type is null"); requireNonNull(scope, "scope is null"); requireNonNull(sources, "sources is null"); requireNonNull(partitioningScheme, "partitioningScheme is null"); requireNonNull(inputs, "inputs is null"); requireNonNull(orderingScheme, "orderingScheme is null"); checkArgument(!inputs.isEmpty(), "inputs is empty"); checkArgument(inputs.stream().allMatch(inputSymbols -> inputSymbols.size() == partitioningScheme.getOutputLayout().size()), "Input symbols do not match output symbols"); checkArgument(inputs.size() == sources.size(), "Must have same number of input lists as sources"); for (int i = 0; i < inputs.size(); i++) { checkArgument(sources.get(i).getOutputSymbols().containsAll(inputs.get(i)), "Source does not supply all required input symbols"); } checkArgument(scope != LOCAL || partitioningScheme.getPartitioning().getArguments().stream().allMatch(ArgumentBinding::isVariable), "local exchanges do not support constant partition function arguments"); checkArgument(scope != REMOTE || type == Type.REPARTITION || !partitioningScheme.isReplicateNullsAndAny(), "Only REPARTITION can replicate remotely"); checkArgument(type == Type.GATHER || !orderingScheme.isPresent(), "ordering scheme can be set only for GATHERING"); orderingScheme.ifPresent(ordering -> sources.forEach(source -> checkArgument(source.getOutputSymbols().containsAll(ordering.getOrderBy()), "Source does not supply all required ordering symbols"))); this.type = type; this.sources = sources; this.scope = scope; this.partitioningScheme = partitioningScheme; this.inputs = listOfListsCopy(inputs); this.orderingScheme = orderingScheme; }