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

view shouldn't use current catalog and namespace to lookup function

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.1
    • 3.1.0
    • SQL
    • None

    Description

      Reproduce steps:
      spark.sql("CREATE FUNCTION udf_plus AS 'udf.UdfPlus10' USING JAR '/home/linhong.liu/spark-udf_2.12-0.1.0-SNAPSHOT.jar'")

      spark.sql("create view v1 as select udf_plus(1)")
      spark.sql("select * from v1").show() // output 11

      spark.sql("CREATE TEMPORARY FUNCTION udf_plus AS 'udf.UdfPlus20' USING JAR '/home/linhong.liu/spark-udf_2.12-0.1.0-SNAPSHOT.jar'")

      spark.sql("select * from v1").show() // throw exception

      org.apache.spark.sql.AnalysisException: Attribute with name 'default.udf_plus(1)' is not found in '(udf_plus(1))';;
      Project default.udf_plus(1)#60
      +- SubqueryAlias spark_catalog.default.v1
      +- View (`default`.`v1`, default.udf_plus(1)#60)
      +- Project HiveSimpleUDF#udf.UdfPlus20(1) AS udf_plus(1)#61
      +- OneRowRelation

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            linhongliu-db Linhong Liu
            linhongliu-db Linhong Liu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment