aboutsummaryrefslogtreecommitdiff
path: root/sql/catalyst
diff options
context:
space:
mode:
authorHerman van Hovell <hvanhovell@databricks.com>2016-06-10 14:29:05 -0700
committerDavies Liu <davies.liu@gmail.com>2016-06-10 14:29:05 -0700
commite05a2feebe928df691d5a8f42f22e088c6263dcf (patch)
treed4e31d19e13de1ef0047d0d4c6546c6be8e3ca90 /sql/catalyst
parent026eb90644be7685971dacaabae67a293edd0133 (diff)
downloadspark-e05a2feebe928df691d5a8f42f22e088c6263dcf.tar.gz
spark-e05a2feebe928df691d5a8f42f22e088c6263dcf.tar.bz2
spark-e05a2feebe928df691d5a8f42f22e088c6263dcf.zip
[SPARK-15825] [SQL] Fix SMJ invalid results
## What changes were proposed in this pull request? Code generated `SortMergeJoin` failed with wrong results when using structs as keys. This could (eventually) be traced back to the use of a wrong row reference when comparing structs. ## How was this patch tested? TBD Author: Herman van Hovell <hvanhovell@databricks.com> Closes #13589 from hvanhovell/SPARK-15822.
Diffstat (limited to 'sql/catalyst')
-rw-r--r--sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala
index 9657f26402..ca202928e8 100644
--- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala
+++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala
@@ -490,6 +490,7 @@ class CodegenContext {
addNewFunction(compareFunc, funcCode)
s"this.$compareFunc($c1, $c2)"
case schema: StructType =>
+ INPUT_ROW = "i"
val comparisons = GenerateOrdering.genComparisons(this, schema)
val compareFunc = freshName("compareStruct")
val funcCode: String =