cloud-fan commented on code in PR #50101: URL: https://github.com/apache/spark/pull/50101#discussion_r1974712264
########## connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/PostgresIntegrationSuite.scala: ########## @@ -304,11 +309,25 @@ class PostgresIntegrationSuite extends DockerJDBCIntegrationV2Suite with V2JDBCT assert(rows7.length === 1) assert(rows7(0).getString(0) === "alex") - val df8 = sql(s"SELECT name FROM $tbl WHERE dayofweek(date1) = 4") - checkFilterPushed(df8) - val rows8 = df8.collect() - assert(rows8.length === 1) - assert(rows8(0).getString(0) === "alex") + withClue("dayofweek") { + val dow = sql(s"SELECT dayofweek(date1) FROM $tbl WHERE name = 'alex'") + .collect().head.getInt(0) + val df = sql(s"SELECT name FROM $tbl WHERE dayofweek(date1) = $dow") Review Comment: A better idea is probably have a test infra that automatically checks the result between JDBC pushdown on and off. I'll leave it to followups. ########## connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/PostgresIntegrationSuite.scala: ########## @@ -304,11 +309,25 @@ class PostgresIntegrationSuite extends DockerJDBCIntegrationV2Suite with V2JDBCT assert(rows7.length === 1) assert(rows7(0).getString(0) === "alex") - val df8 = sql(s"SELECT name FROM $tbl WHERE dayofweek(date1) = 4") - checkFilterPushed(df8) - val rows8 = df8.collect() - assert(rows8.length === 1) - assert(rows8(0).getString(0) === "alex") + withClue("dayofweek") { + val dow = sql(s"SELECT dayofweek(date1) FROM $tbl WHERE name = 'alex'") + .collect().head.getInt(0) + val df = sql(s"SELECT name FROM $tbl WHERE dayofweek(date1) = $dow") Review Comment: A better idea is probably having a test infra that automatically checks the result between JDBC pushdown on and off. I'll leave it to followups. -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org