beliefer commented on code in PR #44357:
URL: https://github.com/apache/spark/pull/44357#discussion_r1439010177
##########
connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/MySQLIntegrationSuite.scala:
##########
@@ -163,4 +164,29 @@ class MySQLIntegrationSuite extends
DockerJDBCIntegrationV2Suite with V2JDBCTest
assert(sql(s"SELECT char_length(c1) from $tableName").head().get(0) ===
65536)
}
}
+
+ test("SPARK-46408: Scan with filter push-down with date time functions") {
+ val tableName = catalogName + ".datetime"
+ withTable(tableName) {
+ sql(s"CREATE TABLE $tableName(name varchar(32), date1 DATE, time1
TIMESTAMP)")
+ val df1 = sql(s"SELECT name FROM $tableName where " +
+ "date_add(date1, 1) = '2022-05-20'")
+ checkFilterPushed(df1)
+ val df2 = sql(s"SELECT name FROM $tableName where " +
+ "date_sub(date1, 1) = '2022-05-20'")
+ checkFilterPushed(df2)
+ }
+ }
+
+ private def checkFilterPushed(df: DataFrame, pushed: Boolean = true): Unit =
{
Review Comment:
`checkFilterPushed` already defined in `V2JDBCTest`.
##########
connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/MySQLIntegrationSuite.scala:
##########
@@ -163,4 +164,29 @@ class MySQLIntegrationSuite extends
DockerJDBCIntegrationV2Suite with V2JDBCTest
assert(sql(s"SELECT char_length(c1) from $tableName").head().get(0) ===
65536)
}
}
+
+ test("SPARK-46408: Scan with filter push-down with date time functions") {
Review Comment:
Because this is the first PR, I think it's OK to only push down `date_add`
and `date_sub` for Mysql dialect.
--
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]