[ https://issues.apache.org/jira/browse/SPARK-32877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Apache Spark reassigned SPARK-32877: ------------------------------------ Assignee: Apache Spark > Fix Hive UDF not support decimal type in complex type > ----------------------------------------------------- > > Key: SPARK-32877 > URL: https://issues.apache.org/jira/browse/SPARK-32877 > Project: Spark > Issue Type: Bug > Components: SQL > Affects Versions: 3.1.0 > Reporter: ulysses you > Assignee: Apache Spark > Priority: Minor > > This pr aims to support Hive UDF when input complex type contains decimal > type. > Before this pr, we failed in this code. > {code:java} > class ArraySumUDF extends UDF { > import scala.collection.JavaConverters._ > def evaluate(values: java.util.List[java.lang.Double]): java.lang.Double = { > var r = 0d > for (v <- values.asScala) { > r += v > } > r > } > } > sql(s"CREATE FUNCTION testArraySum AS '${classOf[ArraySumUDF].getName}'") > sql("SELECT testArraySum(array(1, 1.1, 1.2))") > -- failed msg > Error in query: No handler for UDF/UDAF/UDTF 'ArraySumUDF': > org.apache.hadoop.hive.ql.exec.NoMatchingMethodException: No matching method > for class ArraySumUDF with (array<decimal(11,1)>). Possible choices: > _FUNC_(array<double>) ; line 1 pos 7 > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org