[
https://issues.apache.org/jira/browse/SPARK-33692?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Wenchen Fan resolved SPARK-33692.
---------------------------------
Fix Version/s: 3.1.0
Resolution: Fixed
Issue resolved by pull request 30662
[https://github.com/apache/spark/pull/30662]
> 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: Linhong Liu
> Priority: Major
> Fix For: 3.1.0
>
>
> 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: [email protected]
For additional commands, e-mail: [email protected]