[ https://issues.apache.org/jira/browse/SPARK-18527?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15704934#comment-15704934 ]
Fabian Boehnlein commented on SPARK-18527: ------------------------------------------ Thanks [~hvanhovell]. Will be interesting to compare this fix to the native implementation which was also merged into branch-2.1. > UDAFPercentile (bigint, array<double>) needs explicity cast to double > --------------------------------------------------------------------- > > Key: SPARK-18527 > URL: https://issues.apache.org/jira/browse/SPARK-18527 > Project: Spark > Issue Type: Bug > Components: SQL > Affects Versions: 2.0.0, 2.0.1 > Environment: spark-2.0.1-bin-hadoop2.7/bin/spark-shell > Reporter: Fabian Boehnlein > Assignee: Jiang Xingbo > Fix For: 2.1.0 > > > Same bug as SPARK-16228 but > {code}_FUNC_(bigint, array<double>) {code} > instead of > {code}_FUNC_(bigint, double){code} > Fix of SPARK-16228 only fixes the non-array case that was hit. > {code} > sql("select percentile(value, array(0.5,0.99)) from values 1,2,3 T(value)") > {code} > fails in Spark 2 shell. > Longer example > {code} > case class Record(key: Long, value: String) > val recordsDF = spark.createDataFrame((1 to 100).map(i => Record(i.toLong, > s"val_$i"))) > recordsDF.createOrReplaceTempView("records") > sql("SELECT percentile(key, Array(0.95, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, > 0.2, 0.1)) AS test FROM records") > org.apache.spark.sql.AnalysisException: No handler for Hive UDF > 'org.apache.hadoop.hive.ql.udf.UDAFPercentile': > org.apache.hadoop.hive.ql.exec.NoMatchingMethodException: No matching method > for class org.apache.had > oop.hive.ql.udf.UDAFPercentile with (bigint, array<decimal(38,18)>). Possible > choices: _FUNC_(bigint, array<double>) _FUNC_(bigint, double) ; line 1 pos 7 > at > org.apache.hadoop.hive.ql.exec.FunctionRegistry.getMethodInternal(FunctionRegistry.java:1164) > at > org.apache.hadoop.hive.ql.exec.DefaultUDAFEvaluatorResolver.getEvaluatorClass(DefaultUDAFEvaluatorResolver.java:83) > at > org.apache.hadoop.hive.ql.udf.generic.GenericUDAFBridge.getEvaluator(GenericUDAFBridge.java:56) > at > org.apache.hadoop.hive.ql.udf.generic.AbstractGenericUDAFResolver.getEvaluator(AbstractGenericUDAFResolver.java:47){code} -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org