Impala Public Jenkins has submitted this change and it was merged. (
http://gerrit.cloudera.org:8080/9800 )
Change subject: IMPALA-6724: Allow creating/dropping functions with the same
name as built-ins
......................................................................
IMPALA-6724: Allow creating/dropping functions with the same name as built-ins
This patch removes restriction on creating a function with the same name
as the built-in function. The reason for lifting the restriction is to
avoid a name clash when introducing new built-in functions. The patch
also fixes some inconsistent behavior when creating or dropping a function
when 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
- Added end-to-end DDL function tests
Cherry-picks: not for 2.x
Change-Id: Ic30df56ac276970116715c14454a5a2477b185fa
Reviewed-on: http://gerrit.cloudera.org:8080/9800
Reviewed-by: Alex Behm <[email protected]>
Tested-by: Impala Public Jenkins
---
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/AnalyzeStmtsTest.java
M fe/src/test/java/org/apache/impala/analysis/AuthorizationTest.java
M testdata/workloads/functional-query/queries/QueryTest/functions-ddl.test
7 files changed, 195 insertions(+), 26 deletions(-)
Approvals:
Alex Behm: Looks good to me, approved
Impala Public Jenkins: Verified
--
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: merged
Gerrit-Change-Id: Ic30df56ac276970116715c14454a5a2477b185fa
Gerrit-Change-Number: 9800
Gerrit-PatchSet: 17
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: Impala Public Jenkins
Gerrit-Reviewer: Tim Armstrong <[email protected]>
Gerrit-Reviewer: Vuk Ercegovac <[email protected]>