cloud-fan commented on code in PR #36649:
URL: https://github.com/apache/spark/pull/36649#discussion_r882659757
##########
sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCV2Suite.scala:
##########
@@ -1412,4 +1413,15 @@ class JDBCV2Suite extends QueryTest with
SharedSparkSession with ExplainSuiteHel
}
}
}
+
+ test("register dialect specific functions") {
+ H2Dialect.registerFunction("my_avg", IntegralAverage)
Review Comment:
Seems it's hard to do `clearFunctions` for one test case only, how about we
do the following:
1. in `beforeAll`, we register functions to `H2Dialect`
2. in `afterAll`, we clear functions in `H2Dialect`
The result is, the entire test suite will test against a JDBC catalog with a
UDF. Other test suites will use a fresh SparkSession and instantiate new
`JDBCTabeCatalog` instance and won't be affected.
--
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]