Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-25768

Constant argument expecting Hive UDAFs doesn't work

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.3.3, 2.4.0
    • Component/s: SQL
    • Labels:
      None

      Description

       The following doesn't work since SPARK-18186 so it is a regression.

      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)))
          }
        }
      }
      
      

       

        Attachments

          Activity

            People

            • Assignee:
              petertoth Peter Toth
              Reporter:
              petertoth Peter Toth
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: