Copilot commented on code in PR #2426:
URL: https://github.com/apache/auron/pull/2426#discussion_r3649507491
##########
thirdparty/auron-iceberg/src/test/scala/org/apache/auron/iceberg/AuronIcebergIntegrationSuite.scala:
##########
@@ -466,6 +466,31 @@ class AuronIcebergIntegrationSuite
}
}
+ test("iceberg scan pushes STARTS_WITH filters into native scan pruning
predicates") {
+ withTable("local.db.t_residual_starts_with") {
+ sql("create table local.db.t_residual_starts_with (id int, v string)
using iceberg")
+ sql("""
+ |insert into local.db.t_residual_starts_with
+ |values (1, 'alpha'), (2, 'beta'), (3, 'atom'), (4, null)
+ |""".stripMargin)
+ val df = sql("""
+ |select * from local.db.t_residual_starts_with
+ |where v like 'a%'
+ |""".stripMargin)
+ checkAnswer(df, Seq(Row(1, "alpha"), Row(3, "atom")))
+ val nativeScanPlan = icebergScanPlan(df)
+ assert(nativeScanPlan.nonEmpty)
+ val pruningPredicateText =
nativeScanPlan.get.pruningPredicates.mkString("\n")
+ assert(
+ pruningPredicateText.contains("name: \"starts_with\"") &&
+ pruningPredicateText.contains("fun: StartsWith"),
+ pruningPredicateText)
Review Comment:
The test asserts STARTS_WITH pruning by searching for substrings in
`pruningPredicates.mkString`, which depends on protobuf `toString` formatting
and is likely to be brittle across protobuf/scalapb version or formatting
changes. Prefer asserting on the structured `PhysicalExprNode` scalarFunction
fields (name/fun) instead.
--
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]