comphead commented on code in PR #7673:
URL: https://github.com/apache/datafusion-comet/pull/7673#discussion_r4608072591
##########
spark/src/test/scala/org/apache/spark/sql/comet/CometPlanEqualitySuite.scala:
##########
@@ -36,6 +40,73 @@ import org.apache.comet.util.ClassLoaders
class CometPlanEqualitySuite extends AnyFunSuite {
+ test("FileSourceScanExec shim filter indices match the constructor") {
+ val output = Seq(AttributeReference("id", IntegerType)())
+ val scan = ExtendedFileSourceScanExec(
+ output,
+ partitionFilters = Seq(GreaterThan(output.head, Literal(1))),
+ dataFilters = Seq(LessThan(output.head, Literal(10))))
+
+ assert(
+ scan.productElement(ShimFileSourceScanExec.partitionFiltersIndex) ==
scan.partitionFilters)
+ assert(scan.productElement(ShimFileSourceScanExec.dataFiltersIndex) ==
scan.dataFilters)
+ }
Review Comment:
This test pins what `scan canonicalization preserves runtime fields and
Spark normalization` already pins. That test builds
`ExtendedFileSourceScanExec` with non-empty partition and data filters and goes
through `canonicalizeOriginalPlan`, which calls `copyScanWithFilters`. A wrong
shim index makes `replaceArg` throw `IllegalStateException` there. Could this
one be removed?
--
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]