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

Custom functions can't be used in temporary views with CTEs

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 3.1.0
    • Fix Version/s: 3.0.3, 3.1.1
    • Component/s: SQL
    • Labels:
      None
    • Environment:

      Databricks Runtime 8.0

    • Target Version/s:

      Description

      The following query works in Spark 3.0 not Spark 3.1.
       
      Start with:
      spark.udf.registerJavaFunction("custom_func", "com.stuff.path.custom_func", LongType())
       
      Works: * select custom_func()

      • create temporary view blaah as select custom_func()
      • with step_1 as ( select custom_func() ) select * from step_1

      Broken:
      create temporary view blaah as with step_1 as ( select custom_func() ) select * from step_1
       
      followed by:
      select * from blaah
       
      Error:
      Error in SQL statement: AnalysisException: No handler for UDF/UDAF/UDTF 'com.stuff.path.custom_func';

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                petertoth Peter Toth
                Reporter:
                laurikoobas Lauri Koobas
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: