Fredy Wijaya has uploaded a new patch set (#5). (
http://gerrit.cloudera.org:8080/9800 )
Change subject: IMPALA-6724: Incorrect exception handling in create/drop
function statements
......................................................................
IMPALA-6724: Incorrect exception handling in create/drop function statements
This patch removes restriction on creating a function with the same name
as the built-in function. The reason for lifting the reestriction is to
avoid to name clash when introducing new built-in functions. The patch
also fixes some inconsistent behavior when creating or dropping function
whether the name specified is fully-qualified or not.
Refer to the below tables for more information.
Create function:
+---------+-------------+-------------------------+-------------------------------+-------------------------------+
| FQ Name | Built-in DB | Function Name | Existing Behavior
| New Behavior |
+---------+-------------+-------------------------+-------------------------------+-------------------------------+
| Yes | Yes | Same as built-in | Same name exception
| Cannot modify system database |
| Yes | Yes | Different than built-in | Cannot modify system
database | Cannot modify system database |
| Yes | No | Same as built-in | Function created
| Function created |
| Yes | No | Different than built-in | Function created
| Function created |
| No | Yes | Same as built-in | Same name exception
| Cannot modify system database |
| No | Yes | Different than built-in | Cannot modify system
database | Cannot modify system database |
| No | No | Same as built-in | Same name exception
| Function created |
| No | No | Different than built-in | Function created
| Function created |
+---------+-------------+-------------------------+-------------------------------+-------------------------------+
Drop function:
+---------+-------------+-------------------------+-------------------------------+-------------------------------+
| FQ Name | Built-in DB | Function Name | Existing Behavior
| New Behavior |
+---------+-------------+-------------------------+-------------------------------+-------------------------------+
| Yes | Yes | Same as built-in | Cannot modify system
database | Cannot modify system database |
| Yes | Yes | Different than built-in | Cannot modify system
database | Cannot modify system database |
| Yes | No | Same as built-in | Function dropped
| Function dropped |
| Yes | No | Different than built-in | Function dropped
| Function dropped |
| No | Yes | Same as built-in | Cannot modify system
database | Cannot modify system database |
| No | Yes | Different than built-in | Cannot modify system
database | Cannot modify system database |
| No | No | Same as built-in | Cannot modify system
database | Function dropped |
| No | No | Different than built-in | Function dropped
| Function dropped |
+---------+-------------+-------------------------+-------------------------------+-------------------------------+
Select function (no new behavior):
+---------+-------------+-------------------------+--------------------------------------------------------+
| FQ Name | Built-in DB | Function Name | Behavior
|
+---------+-------------+-------------------------+--------------------------------------------------------+
| Yes | Yes | Same as built-in | Function in the specified
database (built-in) executed |
| Yes | Yes | Different than built-in | Unknown function exception
|
| Yes | No | Same as built-in | Function in the specified
database executed |
| Yes | No | Different than built-in | Function in the specified
database executed |
| No | Yes | Same as built-in | Built-in function executed
|
| No | Yes | Different than built-in | Unknown function exception
|
| No | No | Same as built-in | Built-in function executed
|
| No | No | Different than built-in | Function in the current
database executed |
+---------+-------------+-------------------------+--------------------------------------------------------+
Testing:
- Ran front-end tests
Cherry-picks: not for 2.x
Change-Id: Ic30df56ac276970116715c14454a5a2477b185fa
---
M fe/src/main/java/org/apache/impala/analysis/CreateFunctionStmtBase.java
M fe/src/main/java/org/apache/impala/analysis/DropFunctionStmt.java
M fe/src/main/java/org/apache/impala/analysis/FunctionName.java
M fe/src/test/java/org/apache/impala/analysis/AnalyzeDDLTest.java
M fe/src/test/java/org/apache/impala/analysis/AuthorizationTest.java
5 files changed, 66 insertions(+), 22 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/00/9800/5
--
To view, visit http://gerrit.cloudera.org:8080/9800
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic30df56ac276970116715c14454a5a2477b185fa
Gerrit-Change-Number: 9800
Gerrit-PatchSet: 5
Gerrit-Owner: Fredy Wijaya <[email protected]>
Gerrit-Reviewer: Alex Behm <[email protected]>
Gerrit-Reviewer: Bharath Vissapragada <[email protected]>
Gerrit-Reviewer: Fredy Wijaya <[email protected]>
Gerrit-Reviewer: Tim Armstrong <[email protected]>
Gerrit-Reviewer: Vuk Ercegovac <[email protected]>