You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Peter Vary (JIRA)" <ji...@apache.org> on 2018/06/19 05:29:00 UTC

[jira] [Comment Edited] (HIVE-19569) alter table db1.t1 rename db2.t2 generates MetaStoreEventListener.onDropTable()

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

Peter Vary edited comment on HIVE-19569 at 6/19/18 5:28 AM:
------------------------------------------------------------

[~sankarh], [~maheshk114]: The change in {{TestTablesCreateDropAlterTruncate.java}} is actually shows a change in API behaviour, and caused by an unhandled NullPointerException in HiveAlterHandler (https://github.com/apache/hive/blob/master/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveAlterHandler.java#L107). Is this a planned one?
Originally it was handled by catching a NoSuchObjectException and throwing an InvalidOperationException instead here: https://github.com/apache/hive/blob/master/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java#L5012
Not that I think any of these are significantly better than the other :) Just pointing this out because we have written these tests to ensure that the API is backward compatible. We even proposed to clean up the current Exception handling on the dev list, but in the end we decided to stick with the current one in the name of API compatibility.


was (Author: pvary):
[~sankarh], [~maheshk114]: The change in {{TestTablesCreateDropAlterTruncate.java}} is actually a shows a change in API behaviour, and caused by an unhandled NullPointerException in HiveAlterHandler (https://github.com/apache/hive/blob/master/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveAlterHandler.java#L107). Is this a planned one?
Originally it was handled by catching a NoSuchObjectException and throwing an InvalidOperationException instead here: https://github.com/apache/hive/blob/master/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java#L5012
Not that I think any of these are significantly better than the other :) Just pointing this out because we have written these tests to ensure that the API is backward compatible. We even proposed to clean up the current Exception handling on the dev list, but in the end we decided to stick with the current one in the name of API compatibility.

> alter table db1.t1 rename db2.t2 generates MetaStoreEventListener.onDropTable()
> -------------------------------------------------------------------------------
>
>                 Key: HIVE-19569
>                 URL: https://issues.apache.org/jira/browse/HIVE-19569
>             Project: Hive
>          Issue Type: Bug
>          Components: Metastore, Standalone Metastore, Transactions
>    Affects Versions: 3.0.0
>            Reporter: Eugene Koifman
>            Assignee: mahesh kumar behera
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 3.1.0, 4.0.0
>
>         Attachments: HIVE-19569.01-branch-3.patch, HIVE-19569.01.patch, HIVE-19569.02.patch, HIVE-19569.03.patch, HIVE-19569.04.patch
>
>
> When renaming a table within the same DB, this operation causes {{MetaStoreEventListener.onAlterTable()}} to fire but when changing DB name for a table it causes {{MetaStoreEventListener.onDropTable()}} + {{MetaStoreEventListener.onCreateTable()}}.
> The files from original table are moved to new table location.  
> This creates confusing semantics since any logic in {{onDropTable()}} doesn't know about the larger context, i.e. that there will be a matching {{onCreateTable()}}.
> In particular, this causes a problem for Acid tables since files moved from old table use WriteIDs that are not meaningful with the context of new table.
> Current implementation is due to replication.  This should ideally be changed to raise a "not supported" error for tables that are marked for replication.
> cc [~sankarh]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)