...
User will need to implement a DynamicPartitioner, which is responsible for defining the PartitionKey to use for each record.
For each of the partition keys that this DynamicPartitioner returns, a partition will be created in the output PartitionedFileSet dataset.
Code Block | ||
---|---|---|
| ||
/** * Responsible for dynamically determining a @{link PartitionKey}. */ public interface DynamicPartitioner<K, V> { /** * Determine the PartitionKey for the key-value pair to be written to. * * @param key the key to be written * @param value the value to be written * @param logicalStartTime see {@link co.cask.cdap.api.mapreduce.MapReduceContext#getLogicalStartTime} * @return the {@link PartitionKey} for the key-value pair to be written to. */ PartitionKey getPartitionKey(K key, V value, long logicalStartTime); } |
...