This issue is follow up of https://github.com/apache/spark/pull/24286. As Xiao Li pointed out that column with null value is inaccurate as well.
> select key from test;
spark-sql> desc extended test key;
The distinct count should be distinct_count + 1 when the column contains null value.
Wrong outputRows estimation after AggregateEstimation with only null value column
GitHub Pull Request #24436