Description
Spark SQL exists a bug show below:
spark.sql( " SELECT COUNT(DISTINCT 2), COUNT(DISTINCT 2, 3)") .show() +-----------------+--------------------+ |count(DISTINCT 2)|count(DISTINCT 2, 3)| +-----------------+--------------------+ | 1| 1| +-----------------+--------------------+ spark.sql( " SELECT COUNT(DISTINCT 2), COUNT(DISTINCT 3, 2)") .show() +-----------------+--------------------+ |count(DISTINCT 2)|count(DISTINCT 3, 2)| +-----------------+--------------------+ | 1| 0| +-----------------+--------------------+
User 'beliefer' has created a pull request for this issue:
https://github.com/apache/spark/pull/29626