You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/07/26 15:30:45 UTC

[GitHub] [spark] cloud-fan commented on a diff in pull request #37301: [SPARK-39880][SQL] V2 SHOW FUNCTIONS command should print qualified function name like v1

cloud-fan commented on code in PR #37301:
URL: https://github.com/apache/spark/pull/37301#discussion_r930111496


##########
sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowFunctionsSuiteBase.scala:
##########
@@ -141,48 +138,35 @@ trait ShowFunctionsSuiteBase extends QueryTest with DDLCommandTestUtils {
       funs.foreach(createFunction)
       QueryTest.checkAnswer(
         sql(s"SHOW USER FUNCTIONS IN $ns LIKE '*'"),
-        testFuns.map(testFun => Row(showFun("ns", testFun))))
+        testFuns.map(testFun => Row(qualifiedFunName("ns", testFun))))
       QueryTest.checkAnswer(
         sql(s"SHOW USER FUNCTIONS IN $ns LIKE '*rc*'"),
-        Seq("crc32i", "crc16j").map(testFun => Row(showFun("ns", testFun))))
+        Seq("crc32i", "crc16j").map(testFun => Row(qualifiedFunName("ns", testFun))))
     }
   }
 
   test("show a function by its string name") {
-    assume(!isTempFunctions())
     val testFuns = Seq("crc32i", "crc16j")
     withNamespaceAndFuns("ns", testFuns) { (ns, funs) =>
       assert(sql(s"SHOW USER FUNCTIONS IN $ns").isEmpty)
       funs.foreach(createFunction)
       QueryTest.checkAnswer(
         sql(s"SHOW USER FUNCTIONS IN $ns 'crc32i'"),
-        Row(showFun("ns", "crc32i")) :: Nil)
+        Row(qualifiedFunName("ns", "crc32i")) :: Nil)
     }
   }
 
   test("show functions matched to the '|' pattern") {
-    assume(!isTempFunctions())
     val testFuns = Seq("crc32i", "crc16j", "date1900", "Date1")
     withNamespaceAndFuns("ns", testFuns) { (ns, funs) =>
       assert(sql(s"SHOW USER FUNCTIONS IN $ns").isEmpty)
       funs.foreach(createFunction)
       QueryTest.checkAnswer(
         sql(s"SHOW USER FUNCTIONS IN $ns LIKE 'crc32i|date1900'"),
-        Seq("crc32i", "date1900").map(testFun => Row(showFun("ns", testFun))))
+        Seq("crc32i", "date1900").map(testFun => Row(qualifiedFunName("ns", testFun))))
       QueryTest.checkAnswer(
         sql(s"SHOW USER FUNCTIONS IN $ns LIKE 'crc32i|date*'"),
-        Seq("crc32i", "date1900", "Date1").map(testFun => Row(showFun("ns", testFun))))
-    }
-  }
-
-  test("show a function by its id") {

Review Comment:
   Removing it because it's almost the same as `show a function in the USER name space`



-- 
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-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org