GitHub user wzhfy opened a pull request: https://github.com/apache/spark/pull/17630
[SPARK-20318][SQL] Use Catalyst type for min/max in ColumnStat for ease of estimation ## What changes were proposed in this pull request? Currently when estimating predicates like col > literal or col = literal, we will update min or max in column stats based on literal value. However, literal value is of Catalyst type (internal type), while min/max is of external type. This causes unnecessary conversion when comparing them and updating column stats. To solve this, we can use Catalyst type for min/max in ColumnStat for ease of estimation. Note that the persistent form in metastore is still of external type, so there's no inconsistency for statistics in metastore. ## How was this patch tested? Covered by existing tests. You can merge this pull request into a Git repository by running: $ git pull https://github.com/wzhfy/spark refactorColumnStat Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/17630.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 #17630 ---- ---- --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org