Source:
<code>private static PartitionFunction createPartitionFunction( PartitioningProviderManager partitioningProviderManager, Session session, PartitioningHandle partitioning, int partitionCount, List<Type> partitioningChannelTypes, boolean isHashPrecomputed) { if (partitioning.getConnectorHandle() instanceof SystemPartitioningHandle) { HashGenerator hashGenerator; if (isHashPrecomputed) { hashGenerator = new PrecomputedHashGenerator(0); } else { hashGenerator = new InterpretedHashGenerator(partitioningChannelTypes, IntStream.range(0, partitioningChannelTypes.size()).toArray()); } return new LocalPartitionGenerator(hashGenerator, partitionCount); } ConnectorNodePartitioningProvider partitioningProvider = partitioningProviderManager.getPartitioningProvider(partitioning.getConnectorId().get()); ConnectorBucketNodeMap connectorBucketNodeMap = partitioningProvider.getBucketNodeMap( partitioning.getTransactionHandle().orElse(null), session.toConnectorSession(), partitioning.getConnectorHandle()); checkArgument(connectorBucketNodeMap != null, "No partition map %s", partitioning); int bucketCount = connectorBucketNodeMap.getBucketCount(); int[] bucketToPartition = new int[bucketCount]; for (int bucket = 0; bucket < bucketCount; bucket++) { bucketToPartition[bucket] = bucket % partitionCount; } BucketFunction bucketFunction = partitioningProvider.getBucketFunction( partitioning.getTransactionHandle().orElse(null), session.toConnectorSession(), partitioning.getConnectorHandle(), partitioningChannelTypes, bucketCount); <START> checkArgument(bucketFunction != null, "No function %s", partitioning); <END> return new BucketPartitionFunction(bucketFunction, bucketToPartition); }</code><technical_language>nit: "No bucket function for partitioning: %s"</technical_language>

Target:
private static PartitionFunction createPartitionFunction( PartitioningProviderManager partitioningProviderManager, Session session, PartitioningHandle partitioning, int partitionCount, List<Type> partitioningChannelTypes, boolean isHashPrecomputed) { if (partitioning.getConnectorHandle() instanceof SystemPartitioningHandle) { HashGenerator hashGenerator; if (isHashPrecomputed) { hashGenerator = new PrecomputedHashGenerator(0); } else { hashGenerator = new InterpretedHashGenerator(partitioningChannelTypes, IntStream.range(0, partitioningChannelTypes.size()).toArray()); } return new LocalPartitionGenerator(hashGenerator, partitionCount); } ConnectorNodePartitioningProvider partitioningProvider = partitioningProviderManager.getPartitioningProvider(partitioning.getConnectorId().get()); ConnectorBucketNodeMap connectorBucketNodeMap = partitioningProvider.getBucketNodeMap( partitioning.getTransactionHandle().orElse(null), session.toConnectorSession(), partitioning.getConnectorHandle()); checkArgument(connectorBucketNodeMap != null, "No partition map %s", partitioning); int bucketCount = connectorBucketNodeMap.getBucketCount(); int[] bucketToPartition = new int[bucketCount]; for (int bucket = 0; bucket < bucketCount; bucket++) { bucketToPartition[bucket] = bucket % partitionCount; } BucketFunction bucketFunction = partitioningProvider.getBucketFunction( partitioning.getTransactionHandle().orElse(null), session.toConnectorSession(), partitioning.getConnectorHandle(), partitioningChannelTypes, bucketCount); checkArgument(bucketFunction != null, "No bucket function for partitioning: %s", partitioning); return new BucketPartitionFunction(bucketFunction, bucketToPartition); }