问题描述
任何人都可以告诉我Hive的外部表格和内部表格之间的区别。我知道删除表格时会出现差异。我不明白数据是什么意思,元数据在内部被删除,只有外部表中的元数据被删除。
任何人都可以根据节点来解释我。
Hive在它使用的主节点上有一个关系数据库跟踪状态。
例如,当您< CREATE TABLE FOO(foo string)LOCATION'hdfs:// tmp /'; 时,此表模式存储在数据库中。 / p>
如果您有一个分区表,分区将存储在数据库中(这允许配置单元使用分区列表,而无需转到文件系统并找到它们等) 。这些类型的东西都是'元数据'。
当你删除一个内部表格时,它会丢弃数据,并且它会丢弃元数据。
$ b
当您删除外部表格时,它只会删除元数据。这意味着配置单元现在对这些数据一无所知。它不会触及数据本身。
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 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.
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.
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内部表和外部表之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!