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

cannot use UDTF in DataFrame.selectExpr

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.0.0
    • SQL
    • None

    Description

      Currently if use UDTF like `explode`, `json_tuple` in `DataFrame.selectExpr`, it will be parsed into `UnresolvedFunction` first, and then alias it with `expr.prettyString`. However, UDTF may need MultiAlias so we will get error if we run:

      val df = Seq((Map("1" -> 1), 1)).toDF("a", "b")
      df.selectExpr("explode(a)").show()
      

      [info] org.apache.spark.sql.AnalysisException: Expect multiple names given for org.apache.spark.sql.catalyst.expressions.Explode,
      [info] but only single name ''explode(a)' specified;

      Attachments

        Activity

          People

            dkbiswal Dilip Biswal
            cloud_fan Wenchen Fan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: