You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Yuming Wang (Jira)" <ji...@apache.org> on 2021/03/04 16:20:00 UTC
[jira] [Updated] (SPARK-34622) Fix push down limit through join
[ https://issues.apache.org/jira/browse/SPARK-34622?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Yuming Wang updated SPARK-34622:
--------------------------------
Description:
{code:scala}
spark.sql("create table t1(a int, b int, c int) using parquet")
spark.sql("create table t2(x int, y int, z int) using parquet")
spark.sql("select a from t1 left join t2 on a = x and b = y limit 5").explain("cost")
{code}
Current:
{noformat}
== Optimized Logical Plan ==
GlobalLimit 5
+- LocalLimit 5
+- Project [a#0]
+- Join LeftOuter, ((a#0 = x#3) AND (b#1 = y#4))
:- Project [a#0, b#1]
: +- Relation default.t1[a#0,b#1,c#2] parquet
+- Project [x#3, y#4]
+- Filter (isnotnull(x#3) AND isnotnull(y#4))
+- Relation default.t2[x#3,y#4,z#5] parquet
{noformat}
Excepted:
{noformat}
== Optimized Logical Plan ==
GlobalLimit 5
+- LocalLimit 5
+- Project [a#0]
+- Join LeftOuter, ((a#0 = x#3) AND (b#1 = y#4))
:- LocalLimit 5
: +- Project [a#0, b#1]
: +- Relation default.t1[a#0,b#1,c#2] parquet
+- Project [x#3, y#4]
+- Filter (isnotnull(x#3) AND isnotnull(y#4))
+- Relation default.t2[x#3,y#4,z#5] parquet
{noformat}
> Fix push down limit through join
> --------------------------------
>
> Key: SPARK-34622
> URL: https://issues.apache.org/jira/browse/SPARK-34622
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 3.2.0
> Reporter: Yuming Wang
> Priority: Major
>
> {code:scala}
> spark.sql("create table t1(a int, b int, c int) using parquet")
> spark.sql("create table t2(x int, y int, z int) using parquet")
> spark.sql("select a from t1 left join t2 on a = x and b = y limit 5").explain("cost")
> {code}
> Current:
> {noformat}
> == Optimized Logical Plan ==
> GlobalLimit 5
> +- LocalLimit 5
> +- Project [a#0]
> +- Join LeftOuter, ((a#0 = x#3) AND (b#1 = y#4))
> :- Project [a#0, b#1]
> : +- Relation default.t1[a#0,b#1,c#2] parquet
> +- Project [x#3, y#4]
> +- Filter (isnotnull(x#3) AND isnotnull(y#4))
> +- Relation default.t2[x#3,y#4,z#5] parquet
> {noformat}
> Excepted:
> {noformat}
> == Optimized Logical Plan ==
> GlobalLimit 5
> +- LocalLimit 5
> +- Project [a#0]
> +- Join LeftOuter, ((a#0 = x#3) AND (b#1 = y#4))
> :- LocalLimit 5
> : +- Project [a#0, b#1]
> : +- Relation default.t1[a#0,b#1,c#2] parquet
> +- Project [x#3, y#4]
> +- Filter (isnotnull(x#3) AND isnotnull(y#4))
> +- Relation default.t2[x#3,y#4,z#5] parquet
> {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