-
- Downloads
[SPARK-19350][SQL] Cardinality estimation of Limit and Sample
## What changes were proposed in this pull request? Before this pr, LocalLimit/GlobalLimit/Sample propagates the same row count and column stats from its child, which is incorrect. We can get the correct rowCount in Statistics for GlobalLimit/Sample whether cbo is enabled or not. We don't know the rowCount for LocalLimit because we don't know the partition number at that time. Column stats should not be propagated because we don't know the distribution of columns after Limit or Sample. ## How was this patch tested? Added test cases. Author: wangzhenhua <wangzhenhua@huawei.com> Closes #16696 from wzhfy/limitEstimation.
Showing
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala 23 additions, 15 deletions...rk/sql/catalyst/plans/logical/basicLogicalOperators.scala
- sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/statsEstimation/BasicStatsEstimationSuite.scala 122 additions, 0 deletions.../catalyst/statsEstimation/BasicStatsEstimationSuite.scala
- sql/core/src/test/scala/org/apache/spark/sql/StatisticsCollectionSuite.scala 0 additions, 24 deletions...cala/org/apache/spark/sql/StatisticsCollectionSuite.scala
Loading
Please register or sign in to comment