Github user yhuai commented on a diff in the pull request:
https://github.com/apache/spark/pull/13413#discussion_r66858447
--- Diff:
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala
---
@@ -187,28 +187,35 @@ class SQLQuerySuite extends QueryTest with
SQLTestUtils with TestHiveSingleton {
}
test("show functions") {
- val allBuiltinFunctions =
FunctionRegistry.builtin.listFunction().toSet[String].toList.sorted
- // The TestContext is shared by all the test cases, some functions may
be registered before
- // this, so we check that all the builtin functions are returned.
- val allFunctions = sql("SHOW functions").collect().map(r => r(0))
- allBuiltinFunctions.foreach { f =>
- assert(allFunctions.contains(f))
- }
withTempDatabase { db =>
- checkAnswer(sql("SHOW functions abs"), Row("abs"))
- checkAnswer(sql("SHOW functions 'abs'"), Row("abs"))
- checkAnswer(sql(s"SHOW functions $db.abs"), Row("abs"))
- checkAnswer(sql(s"SHOW functions `$db`.`abs`"), Row("abs"))
- checkAnswer(sql(s"SHOW functions `$db`.`abs`"), Row("abs"))
- checkAnswer(sql("SHOW functions `~`"), Row("~"))
+ def createFunction(names: Seq[String]): Unit = {
+ names.foreach { name =>
+ sql(
+ s"""
+ |CREATE TEMPORARY FUNCTION $name
+ |AS '${classOf[PairUDF].getName}'
+ """.stripMargin)
+ }
+ }
+ createFunction(Seq("temp_abs", "temp_weekofyear", "temp_sha",
"temp_sha1", "temp_sha2"))
--- End diff --
Sorry. I missed this in my previous review. Can we drop them at the end of
this test?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]