You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by srowen <gi...@git.apache.org> on 2018/06/07 13:23:09 UTC
[GitHub] spark pull request #21109: [SPARK-24020][SQL] Sort-merge join inner range op...
Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/21109#discussion_r193736438
--- Diff: sql/core/src/test/scala/org/apache/spark/sql/execution/joins/InnerJoinSuite.scala ---
@@ -70,27 +70,41 @@ class InnerJoinSuite extends SparkPlanTest with SharedSQLContext {
(3, 2)
).toDF("a", "b")
+ private lazy val rangeTestData1 = Seq(
+ (1, 3), (1, 4), (1, 7), (1, 8), (1, 10),
+ (2, 1), (2, 2), (2, 3), (2, 8),
+ (3, 1), (3, 2), (3, 3), (3, 5),
+ (4, 1), (4, 2), (4, 3)
+ ).toDF("a", "b")
+
+ private lazy val rangeTestData2 = Seq(
+ (1, 1), (1, 2), (1, 2), (1, 3), (1, 5), (1, 7), (1, 20),
+ (2, 1), (2, 2), (2, 3), (2, 5), (2, 6),
+ (3, 3), (3, 6)
+ ).toDF("a", "b")
+
// Note: the input dataframes and expression must be evaluated lazily because
// the SQLContext should be used only within a test to keep SQL tests stable
private def testInnerJoin(
- testName: String,
- leftRows: => DataFrame,
- rightRows: => DataFrame,
- condition: () => Expression,
- expectedAnswer: Seq[Product]): Unit = {
+ testName: String,
+ leftRows: => DataFrame,
+ rightRows: => DataFrame,
+ condition: () => Expression,
+ expectedAnswer: Seq[Product],
+ expectRangeJoin: Boolean = false): Unit = {
def extractJoinParts(): Option[ExtractEquiJoinKeys.ReturnType] = {
val join = Join(leftRows.logicalPlan, rightRows.logicalPlan, Inner, Some(condition()))
ExtractEquiJoinKeys.unapply(join)
}
def makeBroadcastHashJoin(
- leftKeys: Seq[Expression],
- rightKeys: Seq[Expression],
- boundCondition: Option[Expression],
- leftPlan: SparkPlan,
- rightPlan: SparkPlan,
- side: BuildSide) = {
+ leftKeys: Seq[Expression],
--- End diff --
(Undo this whitespace change and the next one)
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org