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

Yuming Wang resolved SPARK-35908.
---------------------------------
    Resolution: Not A Problem

> Remove repartition if the child maximum number of rows less than or equal to 1
> ------------------------------------------------------------------------------
>
>                 Key: SPARK-35908
>                 URL: https://issues.apache.org/jira/browse/SPARK-35908
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 3.2.0
>            Reporter: Yuming Wang
>            Priority: Major
>
> {code:scala}
> spark.sql("select count(*) from range(1, 10, 2, 
> 2)").repartition(10).explain("cost")
> {code}
> Current optimized logical plan:
> {noformat}
> == Optimized Logical Plan ==
> Repartition 10, true, Statistics(sizeInBytes=16.0 B, rowCount=1)
> +- Aggregate [count(1) AS count(1)#2L], Statistics(sizeInBytes=16.0 B, 
> rowCount=1)
>    +- Project, Statistics(sizeInBytes=20.0 B)
>       +- Range (1, 10, step=2, splits=Some(2)), Statistics(sizeInBytes=40.0 
> B, rowCount=5)
> {noformat}
> Expected optimized logical plan:
> {noformat}
> == Optimized Logical Plan ==
> Aggregate [count(1) AS count(1)#2L], Statistics(sizeInBytes=16.0 B, 
> rowCount=1)
> +- Project, Statistics(sizeInBytes=20.0 B)
>    +- Range (1, 10, step=2, splits=Some(2)), Statistics(sizeInBytes=40.0 B, 
> rowCount=5)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to