You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (JIRA)" <ji...@apache.org> on 2017/06/10 02:09:18 UTC

[jira] [Commented] (SPARK-21044) Add `RemoveInvalidRange` optimizer

    [ https://issues.apache.org/jira/browse/SPARK-21044?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16045322#comment-16045322 ] 

Apache Spark commented on SPARK-21044:
--------------------------------------

User 'dongjoon-hyun' has created a pull request for this issue:
https://github.com/apache/spark/pull/18257

> Add `RemoveInvalidRange` optimizer
> ----------------------------------
>
>                 Key: SPARK-21044
>                 URL: https://issues.apache.org/jira/browse/SPARK-21044
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 2.2.0
>            Reporter: Dongjoon Hyun
>
> This issue aims to add an optimizer remove invalid `Range` operator from the beginning. There are two cases of invalidity.
> 1. The `start` and `end` value are equal.
> 2. The sign of `step` does not match `start` and `end`. In this case, SPARK-21041 is reported as a bug, too.
> {code}
> scala> spark.range(0,0,1).explain
> == Physical Plan ==
> *Range (0, 0, step=1, splits=8)
> {code}
> {code}
>   test("remove ranges with invalid combination of start/end/step") {
>     Seq(Range(0, 0, 1, 1), Range(0, 0, -1, 1), Range(1, 10, -1, 1), Range(10, 1, 1, 1)).foreach {
>       query =>
>         val optimized = Optimize.execute(query.analyze)
>         val correctAnswer = LocalRelation(query.output, data = Seq.empty)
>         comparePlans(optimized, correctAnswer)
>     }
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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