“insert into”正在覆盖数据

bq9c1y66  于 2021-05-29  发布在  Hadoop
关注(0)|答案(1)|浏览(288)

互联网对我没有帮助,我对这个问题的了解也很有限。
我有一个表格,其模式如下:

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脚本生成的 insert 通过python pyhive 套餐-> from pyhive import hive 虽然我不使用 insert overwrite ,数据 Query#1 正在被覆盖 Query#2 . 我的报告有什么问题吗?

x9ybnkn6

x9ybnkn61#

删除表名周围的反引号``。
查询1

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

查询2

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

相关问题