Fredy Wijaya has uploaded a new patch set (#16). ( 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 --- 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(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/00/9800/16 -- 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: 16 Gerrit-Owner: Fredy Wijaya <fwij...@cloudera.com> Gerrit-Reviewer: Alex Behm <alex.b...@cloudera.com> Gerrit-Reviewer: Bharath Vissapragada <bhara...@cloudera.com> Gerrit-Reviewer: Fredy Wijaya <fwij...@cloudera.com> Gerrit-Reviewer: Tim Armstrong <tarmstr...@cloudera.com> Gerrit-Reviewer: Vuk Ercegovac <vercego...@cloudera.com>