分区覆盖在hive中

时间:2018-03-20 14:26:54

标签: hive

我有像date_created这样的表结构,在hive中创建的值,分区列为date_created。 截至目前表中的数据是

Date_created , value
Jan,            a
Jan,            b
Jan,            c

现在我需要加载像

这样的新数据
Date_created, value
Feb ,         a
Feb ,         b
Jan ,         z

当这个数据加载到配置单元中时,它会如何? 如果这是一个RDBMS表,那么这是一个简单的插入。但在蜂巢中如何附加它? 因为Jan分区会被Jan,z值覆盖。

1 个答案:

答案 0 :(得分:1)

interface Ent extends Entity { stats: { total: number, color: string } height: number, name: string } declare const myCollection: Collection<Ent>; increment(myCollection, 'some-id', ['stats', 'total']); // okay increment(myCollection, 'some-id', 'height'); // okay increment(myCollection, 'some-id', ['height']); // okay increment(myCollection, 'some-id', ['stats']); // error increment(myCollection, 'some-id', ['stats', 'name']); // error increment(myCollection, 'some-id', ['name']); // error increment(myCollection, 'some-id', ['stats', 'color']); // error increment(myCollection, 'some-id', ['random']); // error 将覆盖数据。

INSERT OVERWRITE TABLE PARTITION (date_created)会追加数据。

请参阅此处的文档:https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DML#LanguageManualDML-InsertingdataintoHiveTablesfromqueries

相关问题