PHILO-HE commented on code in PR #5002:
URL: https://github.com/apache/incubator-gluten/pull/5002#discussion_r1531434409
##########
gluten-core/src/main/scala/org/apache/spark/sql/hive/HiveUDFTransformer.scala:
##########
@@ -22,34 +22,37 @@ import org.apache.spark.sql.catalyst.expressions._
import java.util.Locale
-object HiveSimpleUDFTransformer {
- def isHiveSimpleUDF(expr: Expression): Boolean = {
+object HiveUDFTransformer {
+ def isHiveUDF(expr: Expression): Boolean = {
expr match {
- case _: HiveSimpleUDF => true
+ case _: HiveSimpleUDF | _: HiveGenericUDF => true
case _ => false
}
}
def replaceWithExpressionTransformer(
expr: Expression,
attributeSeq: Seq[Attribute]): ExpressionTransformer = {
- if (!isHiveSimpleUDF(expr)) {
- throw new UnsupportedOperationException(s"Expression $expr is not a
HiveSimpleUDF")
+ val udfName = expr match {
+ case s: HiveSimpleUDF =>
+ s.name.stripPrefix("default.")
+ case g: HiveGenericUDF =>
+ g.name.stripPrefix("default.")
+ case _ =>
+ throw new UnsupportedOperationException(
Review Comment:
Let's use `GlutenNotSupportException`, which is newly introduced for
expected fallback.
--
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]