zhengruifeng commented on code in PR #41687:
URL: https://github.com/apache/spark/pull/41687#discussion_r1251100255
##########
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:
1, since `isDistinct` doesn't works for all functions, what is the behavior
if user invoke unsupported functions like `call_function("abs", true)` ?
2, I guess we can simply make it private?
--
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]