AngersZhuuuu commented on a change in pull request #34453:
URL: https://github.com/apache/spark/pull/34453#discussion_r770263376



##########
File path: 
sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkGetFunctionsOperation.scala
##########
@@ -80,8 +83,20 @@ private[hive] class SparkGetFunctionsOperation(
       parentSession.getUsername)
 
     try {
+      val separateDisplaySystemFunctions =
+        
sqlContext.conf.getConf(SQLConf.THRIFTSERVER_SEPARATE_DISPLAY_SYSTEM_FUNCTION)
+      var matchedBuiltInFunctions = if (separateDisplaySystemFunctions && 
functionPattern == "*"
+        && matchingDbs.nonEmpty) {

Review comment:
       DOne

##########
File path: 
sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkGetFunctionsOperation.scala
##########
@@ -80,8 +83,20 @@ private[hive] class SparkGetFunctionsOperation(
       parentSession.getUsername)
 
     try {
+      val separateDisplaySystemFunctions =
+        
sqlContext.conf.getConf(SQLConf.THRIFTSERVER_SEPARATE_DISPLAY_SYSTEM_FUNCTION)
+      var matchedBuiltInFunctions = if (separateDisplaySystemFunctions && 
functionPattern == "*"
+        && matchingDbs.nonEmpty) {
+        FunctionRegistry.functionSet ++ TableFunctionRegistry.functionSet
+      } else {
+        Set.empty[FunctionIdentifier]
+      }
       matchingDbs.foreach { db =>
         catalog.listFunctions(db, functionPattern).foreach {
+          case (funcIdentifier, "SYSTEM") if separateDisplaySystemFunctions =>

Review comment:
       Done

##########
File path: 
sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkGetFunctionsOperation.scala
##########
@@ -94,6 +109,17 @@ private[hive] class SparkGetFunctionsOperation(
             rowSet.addRow(rowData);
         }
       }
+      matchedBuiltInFunctions.foreach { functionIdentifier =>
+        val info = catalog.lookupFunctionInfo(functionIdentifier)
+        val rowData = Array[AnyRef](
+          DEFAULT_HIVE_CATALOG, // FUNCTION_CAT
+          "SYSTEM", // FUNCTION_SCHEM

Review comment:
       Done




-- 
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]

Reply via email to