Linhong Liu created SPARK-33692:
-----------------------------------

             Summary: Permanent view shouldn't lookup temp functions
                 Key: SPARK-33692
                 URL: https://issues.apache.org/jira/browse/SPARK-33692
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 3.0.1
            Reporter: Linhong Liu


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



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to