Github user hvanhovell commented on a diff in the pull request:
https://github.com/apache/spark/pull/7417#discussion_r35433399
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala ---
@@ -213,10 +213,51 @@ private[sql] abstract class SparkStrategies extends
QueryPlanner[SparkPlan] {
object CartesianProduct extends Strategy {
def apply(plan: LogicalPlan): Seq[SparkPlan] = plan match {
case logical.Join(left, right, _, None) =>
- execution.joins.CartesianProduct(planLater(left),
planLater(right)) :: Nil
+ // For BroadcastCartesianProduct we will broadcast the small size
plan,
+ // for CartesianProduct we will use the small size plan as
cartesian left rdd.
+ if (right.statistics.sizeInBytes <= left.statistics.sizeInBytes) {
+ if (sqlContext.conf.autoBroadcastJoinThreshold > 0 &&
+ right.statistics.sizeInBytes <=
sqlContext.conf.autoBroadcastJoinThreshold) {
--- End diff --
You can use ```CanBroadcast``` extractor in order to determine that a side
is Broadcastable, this will also consider the ```broadcast``` hint, and is
probably more future proof.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]