Vihang Karajgaonkar has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/15849 )

Change subject: IMPALA-9717: Catalog should load and refresh data to 
coordinator when it get table already exists report from metastore
......................................................................


Patch Set 1:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/15849/1/fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java
File fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java:

http://gerrit.cloudera.org:8080/#/c/15849/1/fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java@2448
PS1, Line 2448: Table already exists
May be we should improve this response message. Perhaps something like "Table 
already exists in metastore. Please issue 'INVALIDATE <dbname.tablename>' to 
add it to Impala."


http://gerrit.cloudera.org:8080/#/c/15849/1/fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java@2449
PS1, Line 2449:           Table newTbl = 
catalog_.addIncompleteTable(newTable.getDbName(),
              :                   newTable.getTableName());
              :           addTableToCatalogUpdate(newTbl, response.result);
I think doing this could be confusing since a show tables command previously 
run will not list such a table. The semantics of create table if not exists 
becomes unclear since we are creating a table entry which may give a feedback 
to the user that their create statement was the one which created the table and 
hence they might expect it to have a certain schema for subsequent queries.

For instance, if the HMS table has a schema t1(c1 int) while the user tried to 
issue "create table if not exists t1 (c2 string)" they may expect this table to 
have a column c2 to exist and a subsequent query like select c2 from t1 will 
fail which is not good.

The recommended way to update the metadata of the table is to issue refresh 
table or invalidate table or configure EventsProcessor which will automatically 
create such tables for you in the background.

I think in this case, refresh table will not work currently but invalidate 
tablename; should work and do the expected thing. So may be this patch can be 
modified to enhance the refresh table command to add the table and load it.



--
To view, visit http://gerrit.cloudera.org:8080/15849
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ica938cbd1eead31b057adfdba32916d037c3625f
Gerrit-Change-Number: 15849
Gerrit-PatchSet: 1
Gerrit-Owner: Anonymous Coward <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Vihang Karajgaonkar <[email protected]>
Gerrit-Comment-Date: Sat, 02 May 2020 20:20:12 +0000
Gerrit-HasComments: Yes

Reply via email to