Zouxxyy commented on code in PR #11153:
URL:
https://github.com/apache/incubator-gluten/pull/11153#discussion_r2564781755
##########
gluten-substrait/src/main/scala/org/apache/gluten/execution/BatchScanExecTransformer.scala:
##########
@@ -198,6 +188,15 @@ abstract class BatchScanExecTransformerBase(
@transient override lazy val fileFormat: ReadFileFormat =
BackendsApiManager.getSettings.getSubstraitReadFileFormatV2(scan)
+ override def equals(other: Any): Boolean = other match {
+ case other: BatchScanExecTransformerBase =>
+ this.pushDownFilters == other.pushDownFilters && super.equals(other)
+ case _ =>
+ false
+ }
+
+ override def hashCode(): Int = Objects.hashCode(batch, runtimeFilters,
pushDownFilters)
+
Review Comment:
This is because even though BatchScanExec is a case class, spark still
overwrite the equals and hashCode
See in gluten's `AbstractBatchScanExec` or spark's `BatchScanExec`
```scala
// TODO: unify the equal/hashCode implementation for all data source v2
query plans.
override def equals(other: Any): Boolean = other match {
case other: AbstractBatchScanExec =>
this.batch != null && this.batch == other.batch &&
this.runtimeFilters == other.runtimeFilters &&
this.commonPartitionValues == other.commonPartitionValues &&
this.replicatePartitions == other.replicatePartitions &&
this.applyPartialClustering == other.applyPartialClustering
case _ =>
false
}
override def hashCode(): Int = Objects.hashCode(batch, runtimeFilters)
```
Here add a new val `pushDownFilters `, so we need to overwrite them too.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]