cloud-fan commented on code in PR #36593:
URL: https://github.com/apache/spark/pull/36593#discussion_r877113355
##########
sql/core/src/main/scala/org/apache/spark/sql/catalyst/util/V2ExpressionBuilder.scala:
##########
@@ -201,6 +203,14 @@ class V2ExpressionBuilder(
None
}
// TODO supports other expressions
+ case ApplyFunctionExpression(function, children) =>
+ val childrenExpressions = children.flatMap(generateExpression(_))
+ if (childrenExpressions.length == children.length) {
+ Some(new
GeneralScalarExpression(function.name().toUpperCase(Locale.ROOT),
Review Comment:
UDF is kind of special and I think it's better to have a new v2 API for it,
instead of reusing `GeneralScalarExpression`.
e.g., we can add a `UserDefinedScalaFunction`, which defines the function
name, canonical name and inputs.
##########
sql/core/src/main/scala/org/apache/spark/sql/catalyst/util/V2ExpressionBuilder.scala:
##########
@@ -201,6 +203,14 @@ class V2ExpressionBuilder(
None
}
// TODO supports other expressions
+ case ApplyFunctionExpression(function, children) =>
+ val childrenExpressions = children.flatMap(generateExpression(_))
+ if (childrenExpressions.length == children.length) {
+ Some(new
GeneralScalarExpression(function.name().toUpperCase(Locale.ROOT),
Review Comment:
UDF is kind of special and I think it's better to have a new v2 API for it,
instead of reusing `GeneralScalarExpression`.
e.g., we can add a `UserDefinedScalarFunction`, which defines the function
name, canonical name and inputs.
--
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]