[SPARK-2887] fix bug of countApproxDistinct() when have more than one partition

fix bug of countApproxDistinct() when have more than one partition

Author: Davies Liu <davies.liu@gmail.com>

Closes #1812 from davies/approx and squashes the following commits:

bf757ce [Davies Liu] fix bug of countApproxDistinct() when have more than one partition
(cherry picked from commit ffd1f59a62a9dd9a4d5a7b09490b9d01ff1cd42d)

Signed-off-by: Patrick Wendell <pwendell@gmail.com>