[ 
https://issues.apache.org/jira/browse/SPARK-33692?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Apache Spark reassigned SPARK-33692:
------------------------------------

    Assignee: Apache Spark

> Permanent view shouldn't use current catalog and namespace to lookup function
> -----------------------------------------------------------------------------
>
>                 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
>            Assignee: Apache Spark
>            Priority: Major
>
> 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