Skip to content

Conversation

@gatorsmile
Copy link
Member

@gatorsmile gatorsmile commented May 30, 2017

What changes were proposed in this pull request?

We are unable to call the function registered in the not-current database.

sql("CREATE DATABASE dAtABaSe1")
sql(s"CREATE FUNCTION dAtABaSe1.test_avg AS '${classOf[GenericUDAFAverage].getName}'")
sql("SELECT dAtABaSe1.test_avg(1)")

The above code returns an error:

Undefined function: 'dAtABaSe1.test_avg'. This function is neither a registered temporary function nor a permanent function registered in the database 'default'.; line 1 pos 7

This PR is to fix the above issue.

How was this patch tested?

Added test cases.

@SparkQA
Copy link

SparkQA commented May 30, 2017

Test build #77542 has finished for PR 18146 at commit dbacc19.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@dongjoon-hyun
Copy link
Member

+1, LGTM.

@gatorsmile
Copy link
Member Author

cc @cloud-fan

Thanks! @dongjoon-hyun

@cloud-fan
Copy link
Contributor

LGTM, merging to master/2.2!

asfgit pushed a commit that referenced this pull request May 30, 2017
…current database

### What changes were proposed in this pull request?
We are unable to call the function registered in the not-current database.
```Scala
sql("CREATE DATABASE dAtABaSe1")
sql(s"CREATE FUNCTION dAtABaSe1.test_avg AS '${classOf[GenericUDAFAverage].getName}'")
sql("SELECT dAtABaSe1.test_avg(1)")
```
The above code returns an error:
```
Undefined function: 'dAtABaSe1.test_avg'. This function is neither a registered temporary function nor a permanent function registered in the database 'default'.; line 1 pos 7
```

This PR is to fix the above issue.
### How was this patch tested?
Added test cases.

Author: Xiao Li <[email protected]>

Closes #18146 from gatorsmile/qualifiedFunction.

(cherry picked from commit 4bb6a53)
Signed-off-by: Wenchen Fan <[email protected]>
@asfgit asfgit closed this in 4bb6a53 May 30, 2017
@rajeshcode
Copy link

@gatorsmile
We can't backport this into spark2.1.0 ...

@gatorsmile
Copy link
Member Author

@rajeshcode 2.1 branch is not actively maintained. Please use the 2.2 branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants