Skip to content

Commit e5afeda

Browse files
committed
Strengthen data source v2 operators' equality checks
1 parent aee432c commit e5afeda

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/BatchScanExec.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ case class BatchScanExec(
4848
// TODO: unify the equal/hashCode implementation for all data source v2 query plans.
4949
override def equals(other: Any): Boolean = other match {
5050
case other: BatchScanExec =>
51-
this.batch != null && this.batch == other.batch &&
52-
this.runtimeFilters == other.runtimeFilters &&
51+
this.getClass == other.getClass && this.batch != null &&
52+
this.batch == other.batch && this.runtimeFilters == other.runtimeFilters &&
5353
this.spjParams == other.spjParams
5454
case _ =>
5555
false

sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/ContinuousScanExec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ case class ContinuousScanExec(
3838

3939
// TODO: unify the equal/hashCode implementation for all data source v2 query plans.
4040
override def equals(other: Any): Boolean = other match {
41-
case other: ContinuousScanExec => this.stream == other.stream
41+
case other: ContinuousScanExec => this.getClass == other.getClass && this.stream == other.stream
4242
case _ => false
4343
}
4444

sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/MicroBatchScanExec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ case class MicroBatchScanExec(
4141

4242
// TODO: unify the equal/hashCode implementation for all data source v2 query plans.
4343
override def equals(other: Any): Boolean = other match {
44-
case other: MicroBatchScanExec => this.stream == other.stream
44+
case other: MicroBatchScanExec => this.getClass == other.getClass && this.stream == other.stream
4545
case _ => false
4646
}
4747

0 commit comments

Comments
 (0)