You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Dongjoon Hyun (JIRA)" <ji...@apache.org> on 2019/04/15 22:47:00 UTC

[jira] [Resolved] (SPARK-27351) Wrong outputRows estimation after AggregateEstimation with only null value column

     [ https://issues.apache.org/jira/browse/SPARK-27351?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dongjoon Hyun resolved SPARK-27351.
-----------------------------------
       Resolution: Fixed
         Assignee: peng bo
    Fix Version/s: 3.0.0
                   2.4.2

This is resolved via https://github.com/apache/spark/pull/24286

> Wrong outputRows estimation after AggregateEstimation with only null value column
> ---------------------------------------------------------------------------------
>
>                 Key: SPARK-27351
>                 URL: https://issues.apache.org/jira/browse/SPARK-27351
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.4.1
>            Reporter: peng bo
>            Assignee: peng bo
>            Priority: Major
>             Fix For: 2.4.2, 3.0.0
>
>
> The upper bound of group-by columns row number is to multiply distinct counts of group-by columns. However, column with only null value will cause the output row number to be 0 which is incorrect.
> Ex:
> col1 (distinct: 2, rowCount 2)
> col2 (distinct: 0, rowCount 2)
> group by col1, col2
> Actual: output rows: 0
> Expected: output rows: 2 
> {code:java}
> var outputRows: BigInt = agg.groupingExpressions.foldLeft(BigInt(1))(
>         (res, expr) => res * childStats.attributeStats(expr.asInstanceOf[Attribute]).distinctCount)
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org