cloud-fan commented on a change in pull request #28840:
URL: https://github.com/apache/spark/pull/28840#discussion_r471912000



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/command/functions.scala
##########
@@ -236,6 +236,45 @@ case class ShowFunctionsCommand(
   }
 }
 
+
+/**
+ * A command for users to refresh the persistent function.
+ * The syntax of using this command in SQL is:
+ * {{{
+ *    REFRESH FUNCTION functionName
+ * }}}
+ */
+case class RefreshFunctionCommand(
+    databaseName: Option[String],
+    functionName: String)
+  extends RunnableCommand {
+
+  override def run(sparkSession: SparkSession): Seq[Row] = {
+    val catalog = sparkSession.sessionState.catalog
+    if 
(FunctionRegistry.builtin.functionExists(FunctionIdentifier(functionName))) {

Review comment:
       how about
   ```
   CREATE FUNCTION rand AS 'xxx';
   DESC FUNCTION default.rand;
   ```
   
   I think this is similar to table and temp views. Spark will try to look up 
temp view first, so if the name conflicts, temp view is preferred. But users 
can still use a qualified table name to read the table explicitly.




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

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