HashPartitioner

HashPartitioner is a Partitioner that uses partitions configurable number of partitions.

Table 1. HashPartitioner Attributes and Method
Property Description

numPartitions

Exactly partitions number of partitions

getPartition

0 for null keys and Java’s Object.hashCode for non-null keys (modulo partitions number of partitions or 0 for negative hashes).

equals

true for HashPartitioners with partitions number of partitions. Otherwise, false.

hashCode

Exactly partitions number of partitions

Note
HashPartitioner is the default Partitioner for coalesce transformation with shuffle enabled, e.g. calling repartition.

results matching ""

    No results matching ""