Skip to content

Commit 7fbd3a8

Browse files
committed
clean up ShuffledJoin.createVars and fix unit text
1 parent bb9994a commit 7fbd3a8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/joins/ShuffledJoin.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,17 @@ trait ShuffledJoin extends BaseJoinExec {
6868
|$isNull = $row.isNullAt($i);
6969
|$value = $isNull ? $defaultValue : ($valueCode);
7070
""".stripMargin
71-
val leftVarsDecl =
71+
val varDecl =
7272
s"""
7373
|boolean $isNull = false;
7474
|$javaType $value = $defaultValue;
7575
""".stripMargin
7676
(ExprCode(code, JavaCode.isNullVariable(isNull), JavaCode.variable(value, a.dataType)),
77-
leftVarsDecl)
77+
varDecl)
7878
} else {
7979
val code = code"$value = $valueCode;"
80-
val leftVarsDecl = s"""$javaType $value = $defaultValue;"""
81-
(ExprCode(code, FalseLiteral, JavaCode.variable(value, a.dataType)), leftVarsDecl)
80+
val varDecl = s"""$javaType $value = $defaultValue;"""
81+
(ExprCode(code, FalseLiteral, JavaCode.variable(value, a.dataType)), varDecl)
8282
}
8383
}.unzip
8484
}

sql/core/src/test/scala/org/apache/spark/sql/execution/metric/SQLMetricsSuite.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,8 @@ class SQLMetricsSuite extends SharedSparkSession with SQLMetricsTestUtils
346346
val rightDf = (1 to 10).map(i => (i, i.toString)).toSeq.toDF("key2", "value")
347347
Seq((0L, "right_outer", leftDf, rightDf, 10L, false),
348348
(0L, "left_outer", rightDf, leftDf, 10L, false),
349-
(0L, "right_outer", leftDf, rightDf, 10L, true),
350-
(0L, "left_outer", rightDf, leftDf, 10L, true),
349+
(1L, "right_outer", leftDf, rightDf, 10L, true),
350+
(1L, "left_outer", rightDf, leftDf, 10L, true),
351351
(2L, "left_anti", rightDf, leftDf, 8L, true),
352352
(2L, "left_semi", rightDf, leftDf, 2L, true),
353353
(1L, "left_anti", rightDf, leftDf, 8L, false),

0 commit comments

Comments
 (0)