ulysses-you commented on a change in pull request #29749:
URL: https://github.com/apache/spark/pull/29749#discussion_r490132531
##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUDFs.scala
##########
@@ -47,7 +47,8 @@ private[hive] case class HiveSimpleUDF(
with HiveInspectors
with CodegenFallback
with Logging
- with UserDefinedExpression {
+ with UserDefinedExpression
+ with ImplicitCastInputTypes {
Review comment:
No, `ImplicitTypeCasts` has checked `ScalaUDF ` like `case udf: ScalaUDF
if udf.inputTypes.nonEmpty =>`
##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUDFs.scala
##########
@@ -47,7 +47,8 @@ private[hive] case class HiveSimpleUDF(
with HiveInspectors
with CodegenFallback
with Logging
- with UserDefinedExpression {
+ with UserDefinedExpression
+ with ImplicitCastInputTypes {
Review comment:
No, `ImplicitTypeCasts` has checked `ScalaUDF ` as `case udf: ScalaUDF
if udf.inputTypes.nonEmpty =>`
##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUDFs.scala
##########
@@ -69,6 +70,23 @@ private[hive] case class HiveSimpleUDF(
udfType != null && udfType.deterministic() && !udfType.stateful()
}
+ override def inputTypes: Seq[AbstractDataType] = {
+ val inTypes = children.map(_.dataType)
+ if (!inTypes.exists(_.existsRecursively(_.isInstanceOf[DecimalType]))) {
Review comment:
Yeah.
----------------------------------------------------------------
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]