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

UDFs cannot be evaluated within inline table definition

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.0.0
    • None
    • SQL
    • None

    Description

      spark.udf.register("udf", (input: Double) => input)
      sql("SELECT * FROM (VALUES (CAST(udf('1') AS DOUBLE)), (CAST(udf('Infinity') AS DOUBLE))) v(x)")
      
      org.apache.spark.sql.AnalysisException: cannot evaluate expression CAST(UDF:udf(1) AS DOUBLE) in inline table definition; line 1 pos 23
        at org.apache.spark.sql.catalyst.analysis.package$AnalysisErrorAt.failAnalysis(package.scala:42)
        at org.apache.spark.sql.catalyst.analysis.ResolveInlineTables.$anonfun$validateInputEvaluable$2(ResolveInlineTables.scala:68)
        at org.apache.spark.sql.catalyst.analysis.ResolveInlineTables.$anonfun$validateInputEvaluable$2$adapted(ResolveInlineTables.scala:65)
        at scala.collection.immutable.List.foreach(List.scala:392)
        at org.apache.spark.sql.catalyst.analysis.ResolveInlineTables.$anonfun$validateInputEvaluable$1(ResolveInlineTables.scala:65)
        at org.apache.spark.sql.catalyst.analysis.ResolveInlineTables.$anonfun$validateInputEvaluable$1$adapted(ResolveInlineTables.scala:64)
        at scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:62)
        at scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:55)
        at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:49)
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              gurwls223 Hyukjin Kwon
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: