alekjarmov commented on code in PR #59227:
URL: https://github.com/apache/spark/pull/59227#discussion_r4196748647
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/V2ExpressionBuilder.scala:
##########
Review Comment:
nit: We can reuse the new helper here to stay consistent.
##########
sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCV2Suite.scala:
##########
@@ -267,6 +265,22 @@ class JDBCV2Suite extends SharedSparkSession with
ExplainSuiteHelper {
super.afterAll()
}
+ test("COALESCE with Boolean cast pushes down") {
+ withSQLConf(SQLConf.ANSI_ENABLED.key -> "true") {
Review Comment:
Table cleanup in the JDBC test (JDBCV2Suite.scala:268-282). The test uses
try/finally with a manual `DROP TABLE`, while the rest of the suite uses
withTable("h2.test.abc") { … }. Switching to withTable would match the suite.
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/V2ExpressionBuilder.scala:
##########
@@ -74,6 +74,16 @@ class V2ExpressionBuilder(e: Expression, isPredicate:
Boolean = false) extends L
}
}
+ private def generatePredicate(expr: Expression): Option[V2Predicate] = {
Review Comment:
The same wrapping logic now exists twice (V2ExpressionBuilder.scala:41-52
and :77-85). buildPredicate already wraps a non-predicate Boolean result in
BOOLEAN_EXPRESSION when DATA_SOURCE_ALWAYS_CREATE_V2_PREDICATE is on, and the
new generatePredicate repeats that check. buildPredicate could call
generatePredicate(e) for its wrapping step, so the two can't drift apart.
--
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]