GitHub user hvanhovell opened a pull request:
https://github.com/apache/spark/pull/15542
[SPARK-17996][SQL] Fix unqualified catalog.getFunction(...)
## What changes were proposed in this pull request?
Currently an unqualified `getFunction(..)`call returns a wrong result; the
returned function is shown as temporary function without a database. For
example:
```
scala> sql("create function fn1 as
'org.apache.hadoop.hive.ql.udf.generic.GenericUDFAbs'")
res0: org.apache.spark.sql.DataFrame = []
scala> spark.catalog.getFunction("fn1")
res1: org.apache.spark.sql.catalog.Function = Function[name='fn1',
className='org.apache.hadoop.hive.ql.udf.generic.GenericUDFAbs',
isTemporary='true']
```
This PR fixes this by adding database information to ExpressionInfo (which
is used to store the function information).
## How was this patch tested?
Added more thorough tests to `CatalogSuite`.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/hvanhovell/spark SPARK-17996
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/15542.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 #15542
----
commit 6068e44a0ca7128105f95bc438ed958b57c11f55
Author: Herman van Hovell <[email protected]>
Date: 2016-10-19T02:16:33Z
Fix unqualified catalog.getFunction
----
---
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]