cloud-fan commented on a change in pull request #34904:
URL: https://github.com/apache/spark/pull/34904#discussion_r773129127
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCV2Suite.scala
##########
@@ -633,4 +715,30 @@ class JDBCV2Suite extends QueryTest with
SharedSparkSession with ExplainSuiteHel
}
checkAnswer(query, Seq(Row(29000.0)))
}
+
+ test("scan with aggregate push-down: SUM(CASE WHEN) with group by") {
+ val df =
+ sql("SELECT SUM(CASE WHEN SALARY > 0 THEN 1 ELSE 0 END) FROM
h2.test.employee GROUP BY DEPT")
+ checkAggregateRemoved(df, false)
+ df.queryExecution.optimizedPlan.collect {
+ case _: DataSourceV2ScanRelation =>
+ val expected_plan_fragment =
+ "PushedFilters: [], "
+ checkKeywordsExistsInExplain(df, expected_plan_fragment)
+ }
+ checkAnswer(df, Seq(Row(1), Row(2), Row(2)))
+ }
+
+ test("scan with aggregate push-down: SUM(NVL) with group by") {
Review comment:
This test case looks redundant to the above one and we can remove it.
--
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]