From cdea55b5cf63a08af3f9b704b51c3d15ebeb086b Mon Sep 17 00:00:00 2001 From: ulysses Date: Wed, 24 Jun 2020 08:18:16 +0800 Subject: [PATCH] ut nit --- .../spark/sql/execution/command/DDLSuite.scala | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala index 0ff078a7f8968..faafcb721008f 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala @@ -3052,25 +3052,25 @@ abstract class DDLSuite extends QueryTest with SQLTestUtils { val func = FunctionIdentifier("func1", Some("default")) sql("CREATE FUNCTION func1 AS 'test.org.apache.spark.sql.MyDoubleAvg'") - assert(spark.sessionState.catalog.isRegisteredFunction(func) == false) + assert(!spark.sessionState.catalog.isRegisteredFunction(func)) sql("REFRESH FUNCTION func1") - assert(spark.sessionState.catalog.isRegisteredFunction(func) == true) + assert(spark.sessionState.catalog.isRegisteredFunction(func)) spark.sessionState.catalog.externalCatalog.dropFunction("default", "func1") - assert(spark.sessionState.catalog.isRegisteredFunction(func) == true) + assert(spark.sessionState.catalog.isRegisteredFunction(func)) intercept[NoSuchFunctionException] { sql("REFRESH FUNCTION func1") } - assert(spark.sessionState.catalog.isRegisteredFunction(func) == false) + assert(!spark.sessionState.catalog.isRegisteredFunction(func)) val function = CatalogFunction(func, "test.non.exists.udf", Seq.empty) spark.sessionState.catalog.createFunction(function, false) - assert(spark.sessionState.catalog.isRegisteredFunction(func) == false) + assert(!spark.sessionState.catalog.isRegisteredFunction(func)) val err = intercept[AnalysisException] { sql("REFRESH FUNCTION func1") }.getMessage assert(err.contains("Can not load class")) - assert(spark.sessionState.catalog.isRegisteredFunction(func) == false) + assert(!spark.sessionState.catalog.isRegisteredFunction(func)) } } }