[ 
https://issues.apache.org/jira/browse/SPARK-25768?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Peter Toth updated SPARK-25768:
-------------------------------
    Description: 
 

The following doesn't work since -SPARK-18186:(-
{code:java}
test("constant argument expecting Hive UDAF") {
  withTempView("inputTable") {
    spark.range(10).createOrReplaceTempView("inputTable")
    withUserDefinedFunction("testGenericUDAFPercentileApprox" -> false) {
      val numFunc = spark.catalog.listFunctions().count()
      sql(s"CREATE FUNCTION testGenericUDAFPercentileApprox AS '" +
        s"${classOf[GenericUDAFPercentileApprox].getName}'")
      checkAnswer(
        sql("SELECT testGenericUDAFPercentileApprox(id, 0.5) FROM inputTable"),
        Seq(Row(4.0)))
    }
  }
}

{code}
 

  was:
 

The following doesn't work since SPARK-18186:
{code:java}
test("constant argument expecting Hive UDAF") {
  val testData = spark.range(10).toDF()
  withTempView("inputTable") {
    testData.createOrReplaceTempView("inputTable")
    withUserDefinedFunction("testGenericUDAFPercentileApprox" -> false) {
      val numFunc = spark.catalog.listFunctions().count()
      sql(s"CREATE FUNCTION testGenericUDAFPercentileApprox AS '" +
        s"${classOf[GenericUDAFPercentileApprox].getName}'")
      checkAnswer(
        sql("SELECT testGenericUDAFPercentileApprox(id, 0.5) FROM inputTable"),
        Seq(Row(4.0)))
    }
  }
}

{code}
 


> Constant argument expecting Hive UDAFs doesn't work
> ---------------------------------------------------
>
>                 Key: SPARK-25768
>                 URL: https://issues.apache.org/jira/browse/SPARK-25768
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.2.0
>            Reporter: Peter Toth
>            Priority: Major
>
>  
> The following doesn't work since -SPARK-18186:(-
> {code:java}
> test("constant argument expecting Hive UDAF") {
>   withTempView("inputTable") {
>     spark.range(10).createOrReplaceTempView("inputTable")
>     withUserDefinedFunction("testGenericUDAFPercentileApprox" -> false) {
>       val numFunc = spark.catalog.listFunctions().count()
>       sql(s"CREATE FUNCTION testGenericUDAFPercentileApprox AS '" +
>         s"${classOf[GenericUDAFPercentileApprox].getName}'")
>       checkAnswer(
>         sql("SELECT testGenericUDAFPercentileApprox(id, 0.5) FROM 
> inputTable"),
>         Seq(Row(4.0)))
>     }
>   }
> }
> {code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to