[SPARK-2862] histogram method fails on some choices of bucketCount