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/05/29 10:25:00 UTC

[jira] [Commented] (HIVE-19722) Why the hive archive not support EXTERNAL_TABLE?

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

Peter Vary commented on HIVE-19722:
-----------------------------------

[~xuzq_zander]: "An external table describes the metadata / schema on external files. External table files can be accessed and managed by processes outside of Hive.[..] Use external tables when files are already present or in remote locations, and the files should remain even if the table is dropped." - In Hive we do not change the existing file hierarchy for external tables. When dropped / renamed etc. we keep the original structure. AFAIK the Archive function would move exiting files/directories - not really clear what should we do with the EXTERNAL_TABLE files in this case. So I think that is why the author decided to implement the ARCHIVE function only for managed tables.

Hope this helps,

Peter

> Why the hive archive not support EXTERNAL_TABLE?
> ------------------------------------------------
>
>                 Key: HIVE-19722
>                 URL: https://issues.apache.org/jira/browse/HIVE-19722
>             Project: Hive
>          Issue Type: Bug
>            Reporter: xuzq
>            Priority: Major
>
> At present, out tables are EXTERNAL_TABLE, and there is a large amount of metadata information in NameNode, so i need to do archive to reduce the informations. But hive archive is only support MANAGED_TABLE。
>  
> Can someone explain why archive don't support EXTERNAL_TABLE?
> Is there any downsides if i changed the code this way?
>  
> if (!(tbl.getTableType() == TableType.MANAGED_TABLE || tbl.getTableType() == TableType.EXTERNAL_TABLE)) {
>    throw new HiveException("ARCHIVE can only be performed on managed tables");
> }
>  
> Thanks.
>  



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