cloud-fan commented on code in PR #36663:
URL: https://github.com/apache/spark/pull/36663#discussion_r913359517
##########
sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCV2Suite.scala:
##########
@@ -1026,14 +1034,85 @@ class JDBCV2Suite extends QueryTest with
SharedSparkSession with ExplainSuiteHel
|AND cast(dept as short) > 1
|AND cast(bonus as decimal(20, 2)) > 1200""".stripMargin)
checkFiltersRemoved(df6, ansiMode)
- val expectedPlanFragment8 = if (ansiMode) {
+ val expectedPlanFragment6 = if (ansiMode) {
"PushedFilters: [BONUS IS NOT NULL, DEPT IS NOT NULL, " +
"CAST(BONUS AS string) LIKE '%30%', CAST(DEPT AS byte) > 1, ...,"
} else {
"PushedFilters: [BONUS IS NOT NULL, DEPT IS NOT NULL],"
}
- checkPushedInfo(df6, expectedPlanFragment8)
+ checkPushedInfo(df6, expectedPlanFragment6)
checkAnswer(df6, Seq(Row(2, "david", 10000, 1300, true)))
+
+ val df7 = sql("SELECT name FROM h2.test.datetime WHERE " +
+ "dayofyear(date1) > 100 AND dayofmonth(date1) > 10 ")
+ checkFiltersRemoved(df7)
+ val expectedPlanFragment7 =
+ "PushedFilters: [DATE1 IS NOT NULL, EXTRACT(DAY_OF_YEAR FROM DATE1)
> 100, " +
+ "EXTRACT(DAY FROM DATE1) > 10]"
+ checkPushedInfo(df7, expectedPlanFragment7)
+ checkAnswer(df7, Seq(Row("amy"), Row("alex")))
+
+ val df8 = sql("SELECT name FROM h2.test.datetime WHERE " +
+ "year(date1) = 2022 AND quarter(date1) = 2")
+ checkFiltersRemoved(df8)
+ val expectedPlanFragment8 =
+ "[DATE1 IS NOT NULL, EXTRACT(YEAR FROM DATE1) = 2022, " +
+ "EXTRACT(QUARTER FROM DATE1) = 2]"
+ checkPushedInfo(df8, expectedPlanFragment8)
+ checkAnswer(df8, Seq(Row("amy"), Row("alex")))
+
+ val df9 = sql("SELECT name FROM h2.test.datetime WHERE " +
+ "second(time1) = 0 AND month(date1) = 5")
+ checkFiltersRemoved(df9)
+ val expectedPlanFragment9 =
+ "PushedFilters: [TIME1 IS NOT NULL, DATE1 IS NOT NULL,
EXTRACT(SECOND FROM TIME1) = 0, " +
+ "EXTRACT(MONTH FROM DATE1) ..."
Review Comment:
If you don't know how to avoid explain string truncation, @beliefer can you
help?
--
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]