aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/HiveTableScanExec.scala15
1 files changed, 15 insertions, 0 deletions
diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/HiveTableScanExec.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/HiveTableScanExec.scala
index a716a3eab6..231f204b12 100644
--- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/HiveTableScanExec.scala
+++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/HiveTableScanExec.scala
@@ -164,4 +164,19 @@ case class HiveTableScanExec(
}
override def output: Seq[Attribute] = attributes
+
+ override def sameResult(plan: SparkPlan): Boolean = plan match {
+ case other: HiveTableScanExec =>
+ val thisPredicates = partitionPruningPred.map(cleanExpression)
+ val otherPredicates = other.partitionPruningPred.map(cleanExpression)
+
+ val result = relation.sameResult(other.relation) &&
+ output.length == other.output.length &&
+ output.zip(other.output)
+ .forall(p => p._1.name == p._2.name && p._1.dataType == p._2.dataType) &&
+ thisPredicates.length == otherPredicates.length &&
+ thisPredicates.zip(otherPredicates).forall(p => p._1.semanticEquals(p._2))
+ result
+ case _ => false
+ }
}