You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "beliefer (via GitHub)" <gi...@apache.org> on 2023/07/04 09:14:20 UTC

[GitHub] [spark] beliefer commented on a diff in pull request #41687: [SPARK-44131][SQL] Add call_function and deprecate call_udf for Scala API

beliefer commented on code in PR #41687:
URL: https://github.com/apache/spark/pull/41687#discussion_r1251742311


##########
sql/core/src/main/scala/org/apache/spark/sql/functions.scala:
##########
@@ -7715,9 +7688,30 @@ object functions {
    * @since 3.2.0
    */
   @scala.annotation.varargs
-  def call_udf(udfName: String, cols: Column*): Column = withExpr {
-    UnresolvedFunction(udfName, cols.map(_.expr), isDistinct = false)
-  }
+  @deprecated("Use call_function")
+  def call_udf(udfName: String, cols: Column*): Column =
+    call_function(udfName, cols: _*)
+
+  /**
+   * Call a builtin or temp function.
+   *
+   * @param funcName function name
+   * @param cols the expression parameters of function
+   * @since 3.5.0
+   */
+  def call_function(funcName: String, cols: Column*): Column =
+    withExpr { UnresolvedFunction(funcName, cols.map(_.expr), false) }
+
+  /**
+   * Call a builtin or temp function.
+   *
+   * @param funcName function name
+   * @param cols the expression parameters of function
+   * @param isDistinct the distinct for aggregate functions
+   * @since 3.5.0
+   */
+  def call_function(funcName: String, isDistinct: Boolean, cols: Column*): Column =

Review Comment:
   For the first point, could we add call_aggregate_function and call_window_function with `isDistinct` parameter ?



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