You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Michael Armbrust (JIRA)" <ji...@apache.org> on 2015/05/06 04:01:03 UTC
[jira] [Resolved] (SPARK-6231) Join on two tables (generated from
same one) is broken
[ https://issues.apache.org/jira/browse/SPARK-6231?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Armbrust resolved SPARK-6231.
-------------------------------------
Resolution: Fixed
Fix Version/s: 1.4.0
Issue resolved by pull request 5919
[https://github.com/apache/spark/pull/5919]
> Join on two tables (generated from same one) is broken
> ------------------------------------------------------
>
> Key: SPARK-6231
> URL: https://issues.apache.org/jira/browse/SPARK-6231
> Project: Spark
> Issue Type: Sub-task
> Components: SQL
> Affects Versions: 1.3.0
> Reporter: Davies Liu
> Assignee: Reynold Xin
> Priority: Critical
> Labels: DataFrame
> Fix For: 1.4.0
>
>
> If the two column used in joinExpr come from the same table, they have the same id, then the joniExpr is explained in wrong way.
> {code}
> val df = sqlContext.load(path, "parquet")
> val txns = df.groupBy("cust_id").agg($"cust_id", countDistinct($"day_num").as("txns"))
> val spend = df.groupBy("cust_id").agg($"cust_id", sum($"extended_price").as("spend"))
> val rmJoin = txns.join(spend, txns("cust_id") === spend("cust_id"), "inner")
> scala> rmJoin.explain
> == Physical Plan ==
> CartesianProduct
> Filter (cust_id#0 = cust_id#0)
> Aggregate false, [cust_id#0], [cust_id#0,CombineAndCount(partialSets#25) AS txns#7L]
> Exchange (HashPartitioning [cust_id#0], 200)
> Aggregate true, [cust_id#0], [cust_id#0,AddToHashSet(day_num#2L) AS partialSets#25]
> PhysicalRDD [cust_id#0,day_num#2L], MapPartitionsRDD[1] at map at newParquet.scala:542
> Aggregate false, [cust_id#17], [cust_id#17,SUM(PartialSum#38) AS spend#8]
> Exchange (HashPartitioning [cust_id#17], 200)
> Aggregate true, [cust_id#17], [cust_id#17,SUM(extended_price#20) AS PartialSum#38]
> PhysicalRDD [cust_id#17,extended_price#20], MapPartitionsRDD[3] at map at newParquet.scala:542
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org