You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (JIRA)" <ji...@apache.org> on 2017/05/31 09:52:04 UTC

[jira] [Updated] (SPARK-20938) explain() for datasources implementing CatalystScan does not show pushed predicates correctly

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

Hyukjin Kwon updated SPARK-20938:
---------------------------------
    Description: 
Actual pushed-down catalyst predicate expressions look not being represented correctly (but only sources filters) when we use a datasource implementing {{CatalystScan}}. For example, the below case

{code}
df.filter("cast(a as string) == '1' and a < 3").explain()
{code}

prints the plan as below:

{code}
== Physical Plan ==
*Filter (cast(a#0L as string) = 1)
+- *Scan SimpleCatalystScan(0,10) [a#0L] PushedFilters: [*LessThan(a,3)], ReadSchema: struct<a:bigint>
{code}

Actual predicates via {{buildScan(requiredColumns: Seq\[Attribute\], filters: Seq\[Expression\])}} are as below:

{code}
println(filters.mkString("[", ", ", "]"))
{code}

{code}
[(cast(a#0L as string) = 1), (a#0L < 3)]
{code}


  was:
Actual pushed-down catalyst predicate expressions look not being represented correctly (but only sources filters) when we use a datasource implementing {{CatalystScan}}. For example, the below case

```scala
df.filter("cast(a as string) == '1' and a < 3").explain()
```

prints the plan as below:

```
== Physical Plan ==
*Filter (cast(a#0L as string) = 1)
+- *Scan SimpleCatalystScan(0,10) [a#0L] PushedFilters: [*LessThan(a,3)], ReadSchema: struct<a:bigint>
```

Actual predicates via `buildScan(requiredColumns: Seq[Attribute], filters: Seq[Expression])` are as below:

```scala
println(filters.mkString("[", ", ", "]"))
```

```
[(cast(a#0L as string) = 1), (a#0L < 3)]
```



> explain() for datasources implementing CatalystScan does not show pushed predicates correctly
> ---------------------------------------------------------------------------------------------
>
>                 Key: SPARK-20938
>                 URL: https://issues.apache.org/jira/browse/SPARK-20938
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.2.0
>            Reporter: Hyukjin Kwon
>            Priority: Minor
>
> Actual pushed-down catalyst predicate expressions look not being represented correctly (but only sources filters) when we use a datasource implementing {{CatalystScan}}. For example, the below case
> {code}
> df.filter("cast(a as string) == '1' and a < 3").explain()
> {code}
> prints the plan as below:
> {code}
> == Physical Plan ==
> *Filter (cast(a#0L as string) = 1)
> +- *Scan SimpleCatalystScan(0,10) [a#0L] PushedFilters: [*LessThan(a,3)], ReadSchema: struct<a:bigint>
> {code}
> Actual predicates via {{buildScan(requiredColumns: Seq\[Attribute\], filters: Seq\[Expression\])}} are as below:
> {code}
> println(filters.mkString("[", ", ", "]"))
> {code}
> {code}
> [(cast(a#0L as string) = 1), (a#0L < 3)]
> {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