Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/13244#discussion_r64144657
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/execution/joins/BroadcastJoinSuite.scala
---
@@ -56,30 +61,100 @@ class BroadcastJoinSuite extends QueryTest with
BeforeAndAfterAll {
/**
* Test whether the specified broadcast join updates the peak execution
memory accumulator.
*/
- private def testBroadcastJoin[T: ClassTag](name: String, joinType:
String): Unit = {
+ private def testBroadcastJoinPeak[T: ClassTag](name: String, joinType:
String): Unit = {
AccumulatorSuite.verifyPeakExecutionMemorySet(spark.sparkContext,
name) {
- val df1 = spark.createDataFrame(Seq((1, "4"), (2, "2"))).toDF("key",
"value")
- val df2 = spark.createDataFrame(Seq((1, "1"), (2, "2"))).toDF("key",
"value")
- // Comparison at the end is for broadcast left semi join
- val joinExpression = df1("key") === df2("key") && df1("value") >
df2("value")
- val df3 = df1.join(broadcast(df2), joinExpression, joinType)
- val plan =
-
EnsureRequirements(spark.sessionState.conf).apply(df3.queryExecution.sparkPlan)
- assert(plan.collect { case p: T => p }.size === 1)
+ val plan = testBroadcastJoin[T](joinType)
plan.executeCollect()
}
}
+ private def testBroadcastJoin[T: ClassTag](joinType: String,
--- End diff --
would be good to document what this function does briefly.
---
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]