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 (#12).

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

IMPALA-11728: Set fallback database for functions

Currently 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

An example of how to use this feature is listed below. Assuming we
connected to the default database and then execute the statements. The
query executed successfully after setting FALLBACK_DB_FOR_FUNCTIONS.

CREATE FUNCTION util_db.fn() returns int LOCATION '/libTestUdfs.so'
symbol='NoArgs';
set FALLBACK_DB_FOR_FUNCTIONS=util_db;
SELECT fn() from functional.alltypes limit 1;

Testing:
  - Add test_set_fallback_db_for_functions in test_udfs.py.

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/12
--
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: 12
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