You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@impala.apache.org by "Tianyi Wang (JIRA)" <ji...@apache.org> on 2017/09/06 20:26:00 UTC
[jira] [Resolved] (IMPALA-2810) Error message when moving a
partitioned table from one database to another
[ https://issues.apache.org/jira/browse/IMPALA-2810?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tianyi Wang resolved IMPALA-2810.
---------------------------------
Resolution: Fixed
Fix Version/s: Impala 2.10.0
IMPALA-2810: Remove column stats restoration when altering table
This patch removes most code introduced in IMPALA-1711, which triggers
an error message and causes catalog inconsistency when a partitioned
table is moved to a different database.
IMPALA-1711 is a workaround for HIVE-9720, in which column stats is not
properly updated when a table is moved across databases. Hive-9720 has
been resolved in Hive 1.2.0 so the workaround is no longer needed.
A test case moving a partitioned table to a different database is added
to alter-table.test.
Change-Id: I0ca7063ca1aa9faceed9568d22740d91b6dc20d3
Reviewed-on: http://gerrit.cloudera.org:8080/7857
Reviewed-by: Alex Behm <al...@cloudera.com>
Tested-by: Impala Public Jenkins
> Error message when moving a partitioned table from one database to another
> --------------------------------------------------------------------------
>
> Key: IMPALA-2810
> URL: https://issues.apache.org/jira/browse/IMPALA-2810
> Project: IMPALA
> Issue Type: Bug
> Components: Catalog
> Affects Versions: Impala 2.3.2
> Reporter: Mariano Dominguez
> Assignee: Tianyi Wang
> Priority: Minor
> Labels: catalog-server, newbie
> Fix For: Product Backlog, Impala 2.10.0
>
>
> CREATE DATABASE IF NOT EXISTS db1;
> CREATE DATABASE IF NOT EXISTS db2;
> DROP TABLE IF EXISTS db1.tb1;
> DROP TABLE IF EXISTS db2.tb1;
> CREATE TABLE db1.tb1 ( c1 int ) PARTITIONED BY ( c2 string );
> {noformat}
> [localhost.localdomain:21000] > ALTER TABLE db1.tb1 RENAME TO db2.tb1;
> Query: alter TABLE db1.tb1 RENAME TO db2.tb1
> ERROR:
> ImpalaRuntimeException: Error making 'alter_table' RPC to Hive Metastore:
> CAUSED BY: MetaException: Column c2 doesn't exist in table tb1 in database db2
> {noformat}
> Despite the error message, the metastore gets updated...
> INVALIDATE METADATA db1.tb1;
> INVALIDATE METADATA db2.tb1;
> {noformat}
> [localhost.localdomain:21000] > SHOW TABLES IN db1 LIKE 'tb1';
> Query: show TABLES IN db1 LIKE 'tb1'
> Fetched 0 row(s) in 0.01s
> [localhost.localdomain:21000] > SHOW TABLES IN db2 LIKE 'tb1';
> Query: show TABLES IN db2 LIKE 'tb1'
> +------+
> | name |
> +------+
> | tb1 |
> +------+
> {noformat}
> The underlying error comes from the Metastore, but this is not a Metastore bug. It appears as though Impala passes an incorrect parameter to the Metastore. See CatalogOpExecutor.alterTableOrViewRename():
> {code}
> ...
> // Perform the table rename in any case.
> msClient.getHiveClient().alter_table(tableName.getDb(), tableName.getTbl(), msTbl);
> ...
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)