builder.local(localProperties.build()); builder.constants(constants); builder.global(coordinatorSingleStreamPartition()); builder.global(coordinatorSingleStreamPartition()); return builder.build(); boolean coordinatorOnly = node.getPartitioningScheme().getPartitioning().getHandle().isCoordinatorOnly(); return ActualProperties.builder() .global(coordinatorOnly ? coordinatorSingleStreamPartition() : singleStreamPartition()) .local(localProperties.build()) .constants(constants) .build(); case REPARTITION: return ActualProperties.builder() .global(partitionedOn( node.getPartitioningScheme().getPartitioning(), Optional.of(node.getPartitioningScheme().getPartitioning())) .withReplicatedNulls(node.getPartitioningScheme().isReplicateNullsAndAny())) .constants(constants) .build(); case REPLICATE: .global(arbitraryPartition()) .constants(constants) .build();
.global(probeProperties) .local(ImmutableList.of()) .constants(constants) .build(); .constants(constants) .unordered(unordered) .build(); case LEFT: return ActualProperties.builderFrom(probeProperties.translate(column -> filterIfMissing(node.getOutputSymbols(), column))) .unordered(unordered) .build(); case RIGHT: buildProperties = buildProperties.translate(column -> filterIfMissing(node.getOutputSymbols(), column)); .local(ImmutableList.of()) .unordered(unordered) .build(); case FULL: if (probeProperties.getNodePartitioning().isPresent()) { .global(partitionedOn(Partitioning.createWithExpressions(nodePartitioning.getHandle(), coalesceExpressions.build()), Optional.empty())) .unordered(unordered) .build(); .global(probeProperties.isSingleNode() ? singleStreamPartition() : arbitraryPartition()) .unordered(unordered) .build(); default:
.global(streamPartitionedOn("a")) .build()) .add(builder() .global(singleStreamPartition()) .build()) .add(builder() .global(arbitraryPartition()) .local(ImmutableList.of(grouped("a", "b"))) .build()) .add(builder() .global(arbitraryPartition()) .build()) .add(builder() .global(hashDistributedOn("a")) .build()) .add(builder() .global(singleStream()) .local(ImmutableList.of(constant("a"), sorted("b", ASC_NULLS_FIRST))) .build()) .add(builder() .global(singleStreamPartition()) .local(ImmutableList.of(sorted("a", ASC_NULLS_FIRST))) .build()) .add(builder() .global(hashDistributedOn("a")) .build()) .build(); .global(singleStream())
.global(streamPartitionedOn("a")) .build()) .add(builder() .global(singleStreamPartition()) .build()) .add(builder() .global(arbitraryPartition()) .local(ImmutableList.of(grouped("a", "b"))) .build()) .add(builder() .global(arbitraryPartition()) .build()) .add(builder() .global(hashDistributedOn("a")) .build()) .add(builder() .global(singleStream()) .local(ImmutableList.of(constant("a"), sorted("b", ASC_NULLS_FIRST))) .build()) .add(builder() .global(singleStreamPartition()) .local(ImmutableList.of(sorted("a", ASC_NULLS_FIRST))) .build()) .add(builder() .global(hashDistributedOn("a")) .build()) .build(); .global(singleStreamPartition())
.global(streamPartitionedOn("a")) .build()) .add(builder() .global(singleStreamPartition()) .build()) .add(builder() .global(arbitraryPartition()) .local(ImmutableList.of(grouped("a", "b"))) .build()) .add(builder() .global(arbitraryPartition()) .build()) .add(builder() .global(hashDistributedOn("a")) .build()) .add(builder() .global(singleStream()) .local(ImmutableList.of(constant("a"), sorted("b", ASC_NULLS_FIRST))) .build()) .add(builder() .global(singleStreamPartition()) .local(ImmutableList.of(sorted("a", ASC_NULLS_FIRST))) .build()) .add(builder() .global(hashDistributedOn("a")) .build()) .build(); .global(singleStream())
.global(streamPartitionedOn("a")) .build()) .add(builder() .global(singleStreamPartition()) .build()) .add(builder() .global(arbitraryPartition()) .local(ImmutableList.of(grouped("a", "b"))) .build()) .add(builder() .global(arbitraryPartition()) .build()) .add(builder() .global(hashDistributedOn("a")) .build()) .add(builder() .global(singleStream()) .local(ImmutableList.of(constant("a"), sorted("b", ASC_NULLS_FIRST))) .build()) .add(builder() .global(singleStreamPartition()) .local(ImmutableList.of(sorted("a", ASC_NULLS_FIRST))) .build()) .add(builder() .global(hashDistributedOn("a")) .build()) .build(); .global(arbitraryPartition())
.global(streamPartitionedOn("a")) .build()) .add(builder() .global(singleStreamPartition()) .build()) .add(builder() .global(arbitraryPartition()) .local(ImmutableList.of(grouped("a", "b"))) .build()) .add(builder() .global(arbitraryPartition()) .build()) .add(builder() .global(hashDistributedOn("a")) .build()) .add(builder() .global(singleStream()) .local(ImmutableList.of(constant("a"), sorted("b", ASC_NULLS_FIRST))) .build()) .add(builder() .global(singleStreamPartition()) .local(ImmutableList.of(sorted("a", ASC_NULLS_FIRST))) .build()) .build(); .global(streamPartitionedOn("a")) .build()) .add(builder() .global(singleStreamPartition())
.global(streamPartitionedOn("a")) .build()) .add(builder() .global(singleStreamPartition()) .build()) .add(builder() .global(arbitraryPartition()) .local(ImmutableList.of(grouped("a", "b"))) .build()) .add(builder() .global(arbitraryPartition()) .build()) .add(builder() .global(hashDistributedOn("a")) .build()) .add(builder() .global(singleStream()) .local(ImmutableList.of(constant("a"), sorted("b", ASC_NULLS_FIRST))) .build()) .add(builder() .global(singleStreamPartition()) .local(ImmutableList.of(sorted("a", ASC_NULLS_FIRST))) .build()) .build(); .global(streamPartitionedOn("a")) .build()) .add(builder() .global(arbitraryPartition())
.global(streamPartitionedOn("a")) .build()) .add(builder() .global(singleStreamPartition()) .build()) .add(builder() .global(arbitraryPartition()) .local(ImmutableList.of(grouped("a", "b"))) .build()) .add(builder() .global(arbitraryPartition()) .build()) .add(builder() .global(hashDistributedOn("a")) .build()) .add(builder() .global(singleStream()) .local(ImmutableList.of(constant("a"), sorted("b", ASC_NULLS_FIRST))) .build()) .add(builder() .global(singleStreamPartition()) .local(ImmutableList.of(sorted("a", ASC_NULLS_FIRST))) .build()) .add(builder() .global(hashDistributedOn("a")) .build()) .build(); .global(streamPartitionedOn("a"))
.global(streamPartitionedOn("a")) .build()) .add(builder() .global(singleStreamPartition()) .build()) .add(builder() .global(arbitraryPartition()) .local(ImmutableList.of(grouped("a", "b"))) .build()) .add(builder() .global(arbitraryPartition()) .build()) .add(builder() .global(hashDistributedOn("a")) .build()) .add(builder() .global(singleStream()) .local(ImmutableList.of(constant("a"), sorted("b", ASC_NULLS_FIRST))) .build()) .add(builder() .global(singleStreamPartition()) .local(ImmutableList.of(sorted("a", ASC_NULLS_FIRST))) .build()) .add(builder() .global(hashDistributedOn("a")) .build()) .build(); .global(singleStream())
.global(streamPartitionedOn("a")) .build()) .add(builder() .global(singleStreamPartition()) .build()) .add(builder() .global(arbitraryPartition()) .local(ImmutableList.of(grouped("a", "b"))) .build()) .add(builder() .global(arbitraryPartition()) .build()) .add(builder() .global(hashDistributedOn("a")) .build()) .add(builder() .global(singleStream()) .local(ImmutableList.of(constant("a"), sorted("b", ASC_NULLS_FIRST))) .build()) .add(builder() .global(singleStreamPartition()) .local(ImmutableList.of(sorted("a", ASC_NULLS_FIRST))) .build()) .add(builder() .global(hashDistributedOn("a")) .build()) .build(); .global(singleStream())
.global(streamPartitionedOn("a")) .build()) .add(builder() .global(singleStreamPartition()) .build()) .add(builder() .global(arbitraryPartition()) .local(ImmutableList.of(grouped("a", "b"))) .build()) .add(builder() .global(arbitraryPartition()) .build()) .add(builder() .global(hashDistributedOn("a")) .build()) .add(builder() .global(singleStream()) .local(ImmutableList.of(constant("a"), sorted("b", ASC_NULLS_FIRST))) .build()) .add(builder() .global(singleStreamPartition()) .local(ImmutableList.of(sorted("a", ASC_NULLS_FIRST))) .build()) .build(); .global(singleStreamPartition()) .build()) .add(builder() .global(singleStreamPartition())
case GATHER: return ActualProperties.builder() .global(singleStreamPartition()) .constants(constants) .build(); case REPARTITION: return ActualProperties.builder() .global(partitionedOn( node.getPartitionFunction().getPartitioningHandle(), node.getPartitionFunction().getPartitionFunctionArguments(), Optional.of(node.getPartitionFunction().getPartitionFunctionArguments()))) .constants(constants) .build(); case REPLICATE: .global(arbitraryPartition()) .constants(constants) .build();
.global(streamPartitionedOn("a", "b")) .build()) .add(builder() .global(singleStreamPartition()) .build()) .add(builder() .global(arbitraryPartition()) .local(ImmutableList.of(grouped("a", "b"))) .build()) .add(builder() .global(arbitraryPartition()) .build()) .add(builder() .global(hashDistributedOn("a")) .build()) .add(builder() .global(singleStream()) .local(ImmutableList.of(constant("a"), sorted("b", ASC_NULLS_FIRST))) .build()) .add(builder() .global(singleStreamPartition()) .local(ImmutableList.of(sorted("a", ASC_NULLS_FIRST))) .build()) .build();
case INNER: return ActualProperties.builderFrom(probeProperties) .constants(ImmutableMap.<Symbol, NullableValue>builder() .putAll(probeProperties.getConstants()) .putAll(buildProperties.getConstants()) .build()) .build(); case LEFT: return ActualProperties.builderFrom(probeProperties) .constants(probeProperties.getConstants()) .build(); case RIGHT: return ActualProperties.builderFrom(buildProperties) .constants(buildProperties.getConstants()) .local(ImmutableList.of()) .build(); case FULL: .global(probeProperties.isSingleNode() ? singleStreamPartition() : arbitraryPartition()) .build(); default: throw new UnsupportedOperationException("Unsupported join type: " + node.getType());