[ 
https://issues.apache.org/jira/browse/IMPALA-8434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16894147#comment-16894147
 ] 

ASF subversion and git services commented on IMPALA-8434:
---------------------------------------------------------

Commit c501b34fb2ea7378ae0b1b615d9610e93a2e5af0 in impala's branch 
refs/heads/master from stiga-huang
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=c501b34 ]

IMPALA-8434: retain tables and functions in altering database

In the legacy catalog implementation (ImpaladCatalog), when altering a
database, the tables and functions in it will disappear until we run
INVALIDATE METADATA to reset the cache. The cause is that we just
replace the old Db object with the new one deserialized from the
TDatabase. We should migrate the existing tables and functions to the
new Db object.

Tests:
 - Add test_metadata_after_alter_database for the bug.
 - Run Core tests

Change-Id: Ia3dc9857fd2733e20cf10fbe17bb1a4670d7d015
Reviewed-on: http://gerrit.cloudera.org:8080/13904
Reviewed-by: Vihang Karajgaonkar <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>


> Alter Db leads to functions missing unless run "refresh functions" 
> -------------------------------------------------------------------
>
>                 Key: IMPALA-8434
>                 URL: https://issues.apache.org/jira/browse/IMPALA-8434
>             Project: IMPALA
>          Issue Type: Bug
>    Affects Versions: Impala 3.0, Impala 3.1.0, Impala 3.2.0
>            Reporter: Xiaomeng Zhang
>            Assignee: Quanlong Huang
>            Priority: Critical
>             Fix For: Impala 3.3.0
>
>
> I was testing on master branch. In a database with java and native functions. 
> Run queries below, all functions are missing after alter db until run 
> "refresh functions" in db.
> {code:java}
> [localhost:21000] xm> show functions;
> Query: show functions
> +-------------+------------------------+-------------+---------------+
> | return type | signature | binary type | is persistent |
> +-------------+------------------------+-------------+---------------+
> | STRING | add10impala(STRING) | JAVA | true |
> | STRING | add10udf(STRING) | JAVA | true |
> | INT | add2(INT, INT) | NATIVE | true |
> | INT | add2xm(INT, INT) | NATIVE | true |
> | INT | addtwomaster(INT, INT) | NATIVE | true |
> +-------------+------------------------+-------------+---------------+
> Fetched 5 row(s) in 0.01s
> [localhost:21000] xm> alter database xm set owner user impala218;
> Query: alter database xm set owner user impala218
> +-------------------+
> | summary |
> +-------------------+
> | Updated database. |
> +-------------------+
> Fetched 1 row(s) in 0.59s
> [localhost:21000] xm> show functions;
> Query: show functions
> Fetched 0 row(s) in 0.01s
> [localhost:21000] xm> refresh functions xm;
> Query: refresh functions xm
> Query submitted at: 2019-04-18 14:19:00 (Coordinator: 
> http://xiaomeng-OptiPlex-9020:25000)
> Query progress can be monitored at: 
> http://xiaomeng-OptiPlex-9020:25000/query_plan?query_id=fa40cdffde223550:df2a6cc000000000
> Fetched 0 row(s) in 0.08s
> [localhost:21000] xm> show functions;
> Query: show functions
> +-------------+------------------------+-------------+---------------+
> | return type | signature | binary type | is persistent |
> +-------------+------------------------+-------------+---------------+
> | STRING | add10impala(STRING) | JAVA | true |
> | STRING | add10udf(STRING) | JAVA | true |
> | INT | add2(INT, INT) | NATIVE | true |
> | INT | add2xm(INT, INT) | NATIVE | true |
> | INT | addtwomaster(INT, INT) | NATIVE | true |
> +-------------+------------------------+-------------+---------------+
> Fetched 5 row(s) in 0.00s
> {code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to