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 2021/06/29 18:06:00 UTC
[jira] [Resolved] (SPARK-35906) Remove order by if the maximum
number of rows less than or equal to 1
[ https://issues.apache.org/jira/browse/SPARK-35906?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dongjoon Hyun resolved SPARK-35906.
-----------------------------------
Fix Version/s: 3.2.0
Resolution: Fixed
Issue resolved by pull request 33100
[https://github.com/apache/spark/pull/33100]
> Remove order by if the maximum number of rows less than or equal to 1
> ---------------------------------------------------------------------
>
> Key: SPARK-35906
> URL: https://issues.apache.org/jira/browse/SPARK-35906
> Project: Spark
> Issue Type: Improvement
> Components: SQL
> Affects Versions: 3.2.0
> Reporter: Yuming Wang
> Priority: Major
> Fix For: 3.2.0
>
>
> {code:scala}
> spark.sql("select count(*) from range(1, 10, 2, 2) order by 1 limit 10").explain("cost")
> {code}
> Current optimized logical plan:
> {noformat}
> == Optimized Logical Plan ==
> Sort [count(1)#2L ASC NULLS FIRST], true, Statistics(sizeInBytes=16.0 B)
> +- 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-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org