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

Apache Spark commented on SPARK-12536:
--------------------------------------

User 'gatorsmile' has created a pull request for this issue:
https://github.com/apache/spark/pull/10646

> Fix the Explain Outputs of Empty LocalRelation and LocalTableScan
> -----------------------------------------------------------------
>
>                 Key: SPARK-12536
>                 URL: https://issues.apache.org/jira/browse/SPARK-12536
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 1.6.0
>            Reporter: Xiao Li
>            Assignee: Apache Spark
>
> The filter Filter (False) generates an empty LocalRelation in 
> SimplifyFilters. In the current Explain, the optimized and physical plans 
> look confusing.
> For example, 
> {code}
> val df = Seq(1 -> "a").toDF("a", "b")
> df.where("1 = 0").explain(true)
> {code}
> {code}
> == Parsed Logical Plan ==
> Filter (1 = 0)
> +- Project [_1#0 AS a#2,_2#1 AS b#3]
>    +- LocalRelation [_1#0,_2#1], [[1,a]]
> == Analyzed Logical Plan ==
> a: int, b: string
> Filter (1 = 0)
> +- Project [_1#0 AS a#2,_2#1 AS b#3]
>    +- LocalRelation [_1#0,_2#1], [[1,a]]
> == Optimized Logical Plan ==
> LocalRelation [a#2,b#3] 
> == Physical Plan ==
> LocalTableScan [a#2,b#3] 
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to