"insert into" 正在覆盖数据

"insert into" is overwriting data

互联网无济于事,我的知识有限。

我有一个 table,架构如下:

CREATE EXTERNAL TABLE `db.temp_entries`(
  `id` bigint, 
  `random_id` string)
ROW FORMAT SERDE 
  'org.apache.hadoop.hive.ql.io.orc.OrcSerde' 
STORED AS INPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat' 
OUTPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat'
LOCATION
  'hdfs://xxxx/xxxxx/xxx/temp_entries'
TBLPROPERTIES (
  'COLUMN_STATS_ACCURATE'='{\"BASIC_STATS\":\"true\"}', 
  'numFiles'='1', 
  'numRows'='1', 
  'orc.compress'='ZLIB', 
  'rawDataSize'='115', 
  'totalSize'='381', 
  'transient_lastDdlTime'='1532514067')

这里是插入查询 m 使用:

查询 1

insert into `db.temp_entries`
            values (1, 'P1804010001249002159939')

查询 2

insert into `db.temp_entries`
            values (2, 'P1804010001495232931398'),
            (3, 'P1804010002374640308088'),
            (4, 'P1804010009196709498065')

我正在通过 python 脚本生成它,并通过 python pyhive 包执行 insert -> from pyhive import hive

虽然我没有使用 insert overwriteQuery#1 的数据正在被 Query#2 覆盖。我的方法有问题吗?

删除 table 名称周围的反引号 ``。

查询 1

insert into db.temp_entries
            values (1, 'P1804010001249002159939')

查询 2

insert into db.temp_entries
            values (2, 'P1804010001495232931398'),
            (3, 'P1804010002374640308088'),
            (4, 'P1804010009196709498065')