implement partitionWithPK