GitHub user wangyang1992 opened a pull request:
https://github.com/apache/spark/pull/13177
[SPARK-15388][SQL] Fix spark sql CREATE FUNCTION using hive 1.2.1
## What changes were proposed in this pull request?
spark.sql("CREATE FUNCTION myfunc AS 'com.haizhi.bdp.udf.UDFGetGeoCode'")
throws
"org.apache.hadoop.hive.ql.metadata.HiveException:MetaException(message:NoSuchObjectException(message:Function
default.myfunc does not exist))" using hive 1.2.1.
I think it is introduced by pr #12853. Fixing it by catching Exception (not
NoSuchObjectException) and string matching.
## How was this patch tested?
added a unit test and also tested it manually
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/wangyang1992/spark fixCreateFunc2
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/13177.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #13177
----
commit 08435b91b07a9f9aebde493aeec5725e28756ea7
Author: wangyang <[email protected]>
Date: 2016-05-18T19:56:19Z
fix create table with hive 1.2.1
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]