GitHub user wzhfy opened a pull request:
https://github.com/apache/spark/pull/17918
[SPARK-20678][SQL] Ndv for columns not in filter condition should also be
updated
## What changes were proposed in this pull request?
In filter estimation, we update column stats for those columns in filter
condition. However, if the number of rows decreases after the filter (i.e. the
overall selectivity is less than 1), we need to update (scale down) the number
of distinct values (NDV) for all columns, no matter they are in filter
conditions or not.
This pr also fixes the inconsistency of rounding mode for ndv and rowCount.
## How was this patch tested?
Added new tests.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/wzhfy/spark scaleDownNdvAfterFilter
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/17918.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #17918
----
commit 39b72caff37dc3da1e50beccfbe58f56cedf8007
Author: wangzhenhua <[email protected]>
Date: 2017-05-09T08:25:37Z
update ndv for all columns
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]