Skip to content
Prev Previous commit
Next Next commit
follow commment
  • Loading branch information
AngersZhuuuu committed Oct 17, 2019
commit bc04f99fcb7ac98b12acbfdb19df332595b94003
Original file line number Diff line number Diff line change
Expand Up @@ -2064,7 +2064,7 @@ abstract class DDLSuite extends QueryTest with SQLTestUtils {

test("show functions") {
withUserDefinedFunction("add_one" -> true) {
val numFunctions = FunctionRegistry.functionSet.size.toLong + 4L
val numFunctions = FunctionRegistry.functionSet.size.toLong + FunctionsCommand.virtualOperators.size
assert(sql("show functions").count() === numFunctions)
assert(sql("show system functions").count() === numFunctions)
assert(sql("show all functions").count() === numFunctions)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import org.apache.hadoop.io.{LongWritable, Writable}

import org.apache.spark.sql.{AnalysisException, QueryTest, Row}
import org.apache.spark.sql.catalyst.plans.logical.Project
import org.apache.spark.sql.execution.command.FunctionsCommand
import org.apache.spark.sql.functions.max
import org.apache.spark.sql.hive.test.TestHiveSingleton
import org.apache.spark.sql.internal.SQLConf
Expand Down Expand Up @@ -563,7 +564,8 @@ class HiveUDFSuite extends QueryTest with TestHiveSingleton with SQLTestUtils {
checkAnswer(
sql("SELECT testUDFToListInt(s) FROM inputTable"),
Seq(Row(Seq(1, 2, 3))))
assert(sql("show functions").count() == numFunc + 5)
assert(sql("show functions").count() ==
numFunc + FunctionsCommand.virtualOperators.size + 1)
assert(spark.catalog.listFunctions().count() == numFunc + 1)
}
}
Expand Down