Quanlong Huang created IMPALA-12396:
---------------------------------------
Summary: Inconsistent error messages between creating hdfs and
kudu/iceberg tables when table exists in HMS
Key: IMPALA-12396
URL: https://issues.apache.org/jira/browse/IMPALA-12396
Project: IMPALA
Issue Type: Bug
Components: Catalog
Reporter: Quanlong Huang
When creating a kudu/iceberg table, we check whether it exists in HMS before
invoking the createTable HMS RPC:
https://github.com/apache/impala/blob/08501cef2df16991bbd99656c696b978f08aeebe/fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java#L3483
https://github.com/apache/impala/blob/08501cef2df16991bbd99656c696b978f08aeebe/fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java#L3714
However, when creating a hdfs table, we just invoke the createTable RPC (when
the table is not in catalog cache):
https://github.com/apache/impala/blob/08501cef2df16991bbd99656c696b978f08aeebe/fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java#L3563
This results in different error messages when the table does exist in HMS but
not exist in catalog cache. E.g. I create a table in Hive and recreate it in an
Impala cluster that has disabled HMS event processing, the error message is
{noformat}
Query: create table hive_tbl(id int)
ERROR: ImpalaRuntimeException: Error making 'createTable' RPC to Hive
Metastore:
CAUSED BY: AlreadyExistsException: Table hive.default.hive_tbl already exists
{noformat}
Creating the same table in kudu format, got different error message:
{noformat}
Query: create table hive_tbl (id int, name string, primary key(id)) partition
by hash(id) partitions 3 stored as kudu
+-----------------------+
| summary |
+-----------------------+
| Table already exists. |
+-----------------------+
Fetched 1 row(s) in 1.63s
{noformat}
We can add the same check in creating HDFS tables and provide the same error
message.
BTW, we might need to mention Metastore: "Table already exists in Metastore".
--
This message was sent by Atlassian Jira
(v8.20.10#820010)