[
https://issues.apache.org/jira/browse/SPARK-33758?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Prakhar Jain updated SPARK-33758:
---------------------------------
Description:
Consider the query:
{noformat}
val planned = sql(
"""
| SELECT t1.id as t1id
| FROM t1, t2
| WHERE t1.id = t2.id
""".stripMargin).queryExecution.executedPlan
println(planned.outputPartitioning)
{noformat}
The output of this will be:
{noformat}
res10: org.apache.spark.sql.catalyst.plans.physical.Partitioning =
(hashpartitioning(it1d#6L, 200) or hashpartitioning(t2id#7L, 200))
{noformat}
This query will have top level Project node which will just project t1.id. So
outputPartitioning of this project node should be:
hashpartitioning(it1d#6L, 200)
cc - [~maropu] [~cloud_fan]
was:
Consider the query:
select t1.id from t1 JOIN t2 on t1.id = t2.id
This query will have top level Project node which will just project t1.id. But
the outputPartitioning of this project node will be:
PartitioningCollection(HashPartitioning(t1.id), HashPartitioning(t2.id))
We should drop HashPartitioning(t2.id) from outputPartitioning of Project node.
cc - [~maropu] [~cloud_fan]
> Prune unnecessary output partitioning when the attribute is not part of
> output.
> -------------------------------------------------------------------------------
>
> Key: SPARK-33758
> URL: https://issues.apache.org/jira/browse/SPARK-33758
> Project: Spark
> Issue Type: Improvement
> Components: SQL
> Affects Versions: 3.0.1, 3.1.0
> Reporter: Prakhar Jain
> Priority: Major
>
> Consider the query:
> {noformat}
> val planned = sql(
> """
> | SELECT t1.id as t1id
> | FROM t1, t2
> | WHERE t1.id = t2.id
> """.stripMargin).queryExecution.executedPlan
> println(planned.outputPartitioning)
> {noformat}
> The output of this will be:
> {noformat}
> res10: org.apache.spark.sql.catalyst.plans.physical.Partitioning =
> (hashpartitioning(it1d#6L, 200) or hashpartitioning(t2id#7L, 200))
> {noformat}
>
> This query will have top level Project node which will just project t1.id. So
> outputPartitioning of this project node should be:
> hashpartitioning(it1d#6L, 200)
>
> cc - [~maropu] [~cloud_fan]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]