Hello Quanlong Huang, lipeng...@sensorsdata.cn, Csaba Ringhofer, Impala Public 
Jenkins,

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/19252

to look at the new patch set (#10).

Change subject: IMPALA-11728: Set fallback database for functions
......................................................................

IMPALA-11728: Set fallback database for functions

Current the create function statement only works on specified database.
When using the function in another database, it will throw an AnalysisException
because the function is unknown in the current database.

Add query option FALLBACK_DB_FOR_FUNCTIONS. When setting fallback database
query option, function names do not need to be fully qualified.

The exact precedence of the functions:
1. _impala_builtins
2. fallback db specified in query option FALLBACK_DB_FOR_FUNCTIONS
3. function in current db

Testing:
  - add test_set_fallback_db_for_functions in test_udfs.py.
    Creating function fn() in unique_database.
    case 1:
    When the function name is fully qualified then this query option
    has no effect.

    case 2:
    Calling the function in default database and throwing an exception
    "default.fn() unknown for database default".

    case 3:
    After setting the query option
    FALLBACK_DB_FOR_FUNCTIONS=unique_database, the query is successful.

    case 4:
    Creating function abs(int) that also exists as builtin function,
    calling the function and it uses the builtin function. Because
    the builtin functions have higher priority.

Change-Id: I37b7e126718fea1c50723cacbaed898b20bb55e5
---
M be/src/service/query-options.cc
M be/src/service/query-options.h
M common/thrift/ImpalaService.thrift
M common/thrift/Query.thrift
M fe/src/main/java/org/apache/impala/analysis/Analyzer.java
M fe/src/main/java/org/apache/impala/analysis/FunctionName.java
M tests/query_test/test_udfs.py
7 files changed, 65 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/52/19252/10
--
To view, visit http://gerrit.cloudera.org:8080/19252
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I37b7e126718fea1c50723cacbaed898b20bb55e5
Gerrit-Change-Number: 19252
Gerrit-PatchSet: 10
Gerrit-Owner: Xiaoqing Gao <gaoxq...@gmail.com>
Gerrit-Reviewer: Anonymous Coward <lipeng...@sensorsdata.cn>
Gerrit-Reviewer: Csaba Ringhofer <csringho...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <huangquanl...@gmail.com>
Gerrit-Reviewer: Xiaoqing Gao <gaoxq...@gmail.com>

Reply via email to