Hive 内部表和外部表的区别? [英] Difference between Hive internal tables and external tables?

查看:28
本文介绍了Hive 内部表和外部表的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能告诉我 Hive 的外部表和内部表之间的区别.我知道在放下桌子时会有所不同.我不明白你说的数据是什么意思,元数据在内部被删除,只有元数据在外部表中被删除.任何人都可以在节点方面解释我吗.

Can anyone tell me the difference between Hive's external table and internal tables. I know the difference comes when dropping the table. I don't understand what you mean by the data and metadata is deleted in internal and only metadata is deleted in external tables. Can anyone explain me in terms of nodes please.

推荐答案

Hive 在它用来跟踪状态的主节点上有一个关系数据库.例如,当您 CREATE TABLE FOO(foo string) LOCATION 'hdfs://tmp/'; 时,此表模式存储在数据库中.

Hive has a relational database on the master node it uses to keep track of state. For instance, when you CREATE TABLE FOO(foo string) LOCATION 'hdfs://tmp/';, this table schema is stored in the database.

如果你有一个分区表,分区存储在数据库中(这允许 hive 使用分区列表而无需进入文件系统并找到它们等).这些东西就是元数据".

If you have a partitioned table, the partitions are stored in the database(this allows hive to use lists of partitions without going to the file-system and finding them, etc). These sorts of things are the 'metadata'.

删除内部表时,它会删除数据,也会删除元数据.

When you drop an internal table, it drops the data, and it also drops the metadata.

当您删除外部表时,它只会删除元数据.这意味着 hive 现在不知道这些数据.它不涉及数据本身.

When you drop an external table, it only drops the meta data. That means hive is ignorant of that data now. It does not touch the data itself.

这篇关于Hive 内部表和外部表的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆