Hive 配置单元中的多次插入覆盖

Hive 配置单元中的多次插入覆盖,hive,hiveql,Hive,Hiveql,我正试图通过以下命令在配置单元中执行多次插入覆盖 INSERT OVERWRITE table results_3 SELECT NULL, res, NULL, NULL FROM results where field= 'title'; 以及第一个命令后的结果_3表的内容 NULL Up On Cripple Creek (2000 Digital Remaster) NULL NULL NULL The Weight (2000 Digital Remaster)

我正试图通过以下命令在配置单元中执行多次插入覆盖

INSERT OVERWRITE  table results_3 SELECT NULL, res, NULL, NULL FROM results where field= 'title';
以及第一个命令后的结果_3表的内容

NULL    Up On Cripple Creek (2000 Digital Remaster) NULL    NULL
NULL    The Weight (2000 Digital Remaster)  NULL    NULL
NULL    Rhythm Of The Rain (LP Version) NULL    NULL
NULL    Who'll Stop the Rain    NULL    NULL
NULL    I Walk the Line NULL    NULL
NULL    Against The Wind    NULL    NULL
NULL    Lyin' Eyes  NULL    NULL
NULL    North To Alaska NULL    NULL
NULL    You Gave Me A Mountain  NULL    NULL
NULL    Night Moves NULL    NULL


INSERT OVERWRITE  table results_3 SELECT NULL, NULL, res, NULL FROM results where field= 'albums';
以及第二个命令后结果_3表的内容

NULL    NULL    The Band    NULL
NULL    NULL    The Band    NULL
NULL    NULL    The Cascades    NULL
NULL    NULL    Creedence Clearwater Revival    NULL
NULL    NULL    Johnny Cash NULL
NULL    NULL    Bob Seger   NULL
NULL    NULL    The Eagles  NULL
NULL    NULL    Johnny Horton   NULL
NULL    NULL    Marty Robbins   NULL
NULL    NULL    Bob Seger   NULL
但我想把这两件事合并在一起。你知道我怎么解决这个问题吗


谢谢

Hive
insert
目前不支持追加

一种简单的方法:
插入覆盖
两个目录。手动合并它。 或
插入到具有不同分区的表中(但实际上不同分区有不同的目录)


请参阅以获取更多信息。

您可以通过以下方式附加:

INSERT OVERWRITE TABLE
select col1 ... col2 
from 
(
SELECT col1 ... coln from TABLE  --old data
UNION ALL
SELECT col1 ... col2n from TABLE2 --new data
)

hadoop-dfs-mv
hadoop-dfs-getmerge
如何匹配应该合并的行?您的表的模式是什么?如果结果表中有id,则可以执行联接。