public PartitioningScheme withBucketToPartition(Optional<int[]> bucketToPartition) { return new PartitioningScheme(partitioning, outputLayout, hashColumn, replicateNullsAndAny, bucketToPartition); }
public PartitioningScheme translateOutputLayout(List<Symbol> newOutputLayout) { requireNonNull(newOutputLayout, "newOutputLayout is null"); checkArgument(newOutputLayout.size() == outputLayout.size()); Partitioning newPartitioning = partitioning.translate(symbol -> newOutputLayout.get(outputLayout.indexOf(symbol))); Optional<Symbol> newHashSymbol = hashColumn .map(outputLayout::indexOf) .map(newOutputLayout::get); return new PartitioningScheme(newPartitioning, newOutputLayout, newHashSymbol, replicateNullsAndAny, bucketToPartition); }
public PartitioningScheme translateOutputLayout(List<Symbol> newOutputLayout) { requireNonNull(newOutputLayout, "newOutputLayout is null"); checkArgument(newOutputLayout.size() == outputLayout.size()); Partitioning newPartitioning = partitioning.translate(symbol -> newOutputLayout.get(outputLayout.indexOf(symbol))); Optional<Symbol> newHashSymbol = hashColumn .map(outputLayout::indexOf) .map(newOutputLayout::get); return new PartitioningScheme(newPartitioning, newOutputLayout, newHashSymbol, replicateNullsAndAny, bucketToPartition); }
public static ExchangeNode replicatedExchange(PlanNodeId id, Scope scope, PlanNode child) { return new ExchangeNode( id, ExchangeNode.Type.REPLICATE, scope, new PartitioningScheme(Partitioning.create(FIXED_BROADCAST_DISTRIBUTION, ImmutableList.of()), child.getOutputSymbols()), ImmutableList.of(child), ImmutableList.of(child.getOutputSymbols()), Optional.empty()); }
public static ExchangeNode gatheringExchange(PlanNodeId id, Scope scope, PlanNode child) { return new ExchangeNode( id, ExchangeNode.Type.GATHER, scope, new PartitioningScheme(Partitioning.create(SINGLE_DISTRIBUTION, ImmutableList.of()), child.getOutputSymbols()), ImmutableList.of(child), ImmutableList.of(child.getOutputSymbols()), Optional.empty()); }
public static ExchangeNode replicatedExchange(PlanNodeId id, Scope scope, PlanNode child) { return new ExchangeNode( id, ExchangeNode.Type.REPLICATE, scope, new PartitioningScheme(Partitioning.create(FIXED_BROADCAST_DISTRIBUTION, ImmutableList.of()), child.getOutputSymbols()), ImmutableList.of(child), ImmutableList.of(child.getOutputSymbols()), Optional.empty()); }
public static ExchangeNode mergingExchange(PlanNodeId id, Scope scope, PlanNode child, OrderingScheme orderingScheme) { PartitioningHandle partitioningHandle = scope == LOCAL ? FIXED_PASSTHROUGH_DISTRIBUTION : SINGLE_DISTRIBUTION; return new ExchangeNode( id, Type.GATHER, scope, new PartitioningScheme(Partitioning.create(partitioningHandle, ImmutableList.of()), child.getOutputSymbols()), ImmutableList.of(child), ImmutableList.of(child.getOutputSymbols()), Optional.of(orderingScheme)); }
public static ExchangeNode mergingExchange(PlanNodeId id, Scope scope, PlanNode child, OrderingScheme orderingScheme) { PartitioningHandle partitioningHandle = scope == LOCAL ? FIXED_PASSTHROUGH_DISTRIBUTION : SINGLE_DISTRIBUTION; return new ExchangeNode( id, Type.GATHER, scope, new PartitioningScheme(Partitioning.create(partitioningHandle, ImmutableList.of()), child.getOutputSymbols()), ImmutableList.of(child), ImmutableList.of(child.getOutputSymbols()), Optional.of(orderingScheme)); }
public static ExchangeNode gatheringExchange(PlanNodeId id, Scope scope, PlanNode child) { return new ExchangeNode( id, ExchangeNode.Type.GATHER, scope, new PartitioningScheme(Partitioning.create(SINGLE_DISTRIBUTION, ImmutableList.of()), child.getOutputSymbols()), ImmutableList.of(child), ImmutableList.of(child.getOutputSymbols()), Optional.empty()); }
public static ExchangeNode roundRobinExchange(PlanNodeId id, Scope scope, PlanNode child) { return partitionedExchange( id, scope, child, new PartitioningScheme(Partitioning.create(FIXED_ARBITRARY_DISTRIBUTION, ImmutableList.of()), child.getOutputSymbols())); }
public static ExchangeNode roundRobinExchange(PlanNodeId id, Scope scope, PlanNode child) { return partitionedExchange( id, scope, child, new PartitioningScheme(Partitioning.create(FIXED_ARBITRARY_DISTRIBUTION, ImmutableList.of()), child.getOutputSymbols())); }
public static ExchangeNode partitionedExchange(PlanNodeId id, Scope scope, PlanNode child, List<Symbol> partitioningColumns, Optional<Symbol> hashColumns, boolean replicateNullsAndAny) { return partitionedExchange( id, scope, child, new PartitioningScheme( Partitioning.create(FIXED_HASH_DISTRIBUTION, partitioningColumns), child.getOutputSymbols(), hashColumns, replicateNullsAndAny, Optional.empty())); }
public static String graphvizLogicalPlan(PlanNode plan, TypeProvider types) { PlanFragment fragment = new PlanFragment( new PlanFragmentId("graphviz_plan"), plan, types.allTypes(), SINGLE_DISTRIBUTION, ImmutableList.of(plan.getId()), new PartitioningScheme(Partitioning.create(SINGLE_DISTRIBUTION, ImmutableList.of()), plan.getOutputSymbols()), ungroupedExecution(), StatsAndCosts.empty()); return GraphvizPrinter.printLogical(ImmutableList.of(fragment)); }
public ExchangeBuilder fixedHashDistributionParitioningScheme(List<Symbol> outputSymbols, List<Symbol> partitioningSymbols, Symbol hashSymbol) { return partitioningScheme(new PartitioningScheme(Partitioning.create( FIXED_HASH_DISTRIBUTION, ImmutableList.copyOf(partitioningSymbols)), ImmutableList.copyOf(outputSymbols), Optional.of(hashSymbol))); }
public ExchangeBuilder fixedHashDistributionParitioningScheme(List<Symbol> outputSymbols, List<Symbol> partitioningSymbols, Symbol hashSymbol) { return partitioningScheme(new PartitioningScheme(Partitioning.create( FIXED_HASH_DISTRIBUTION, ImmutableList.copyOf(partitioningSymbols)), ImmutableList.copyOf(outputSymbols), Optional.of(hashSymbol))); }
public ExchangeBuilder fixedHashDistributionParitioningScheme(List<Symbol> outputSymbols, List<Symbol> partitioningSymbols) { return partitioningScheme(new PartitioningScheme(Partitioning.create( FIXED_HASH_DISTRIBUTION, ImmutableList.copyOf(partitioningSymbols)), ImmutableList.copyOf(outputSymbols))); }
public ExchangeBuilder fixedHashDistributionParitioningScheme(List<Symbol> outputSymbols, List<Symbol> partitioningSymbols) { return partitioningScheme(new PartitioningScheme(Partitioning.create( FIXED_HASH_DISTRIBUTION, ImmutableList.copyOf(partitioningSymbols)), ImmutableList.copyOf(outputSymbols))); }
public ExchangeBuilder singleDistributionPartitioningScheme(List<Symbol> outputSymbols) { return partitioningScheme(new PartitioningScheme(Partitioning.create(SINGLE_DISTRIBUTION, ImmutableList.of()), outputSymbols)); }
private PartitioningScheme canonicalize(PartitioningScheme scheme, PlanNode source) { return new PartitioningScheme( scheme.getPartitioning().translate(this::map), mapAndDistinct(source.getOutputSymbols()), scheme.getHashColumn().map(this::map), scheme.isReplicateNullsAndAny(), scheme.getBucketToPartition()); }
private PartitioningScheme canonicalize(PartitioningScheme scheme, PlanNode source) { return new PartitioningScheme( scheme.getPartitioning().translate(this::map), mapAndDistinct(source.getOutputSymbols()), scheme.getHashColumn().map(this::map), scheme.isReplicateNullsAndAny(), scheme.getBucketToPartition()); }