HiveQL select在具有分区的外部表上未按预期工作

HiveQL select在具有分区的外部表上未按预期工作,hive,hiveql,Hive,Hiveql,在我创建的自定义外部表上使用select语句时,我面临一个问题。在使用addpartition命令为年、月、日创建表之后,我向该表添加了分区 我面临的问题是,对于这个select语句,我只得到一行,其中day=1,而我期望5天内有5行 select * from test_data where key = 'AX001'; 对于这些陈述,我得到一个结果 select * from test_data where key = 'AX001' and day = 2; select * from

在我创建的自定义外部表上使用select语句时,我面临一个问题。在使用addpartition命令为年、月、日创建表之后,我向该表添加了分区

我面临的问题是,对于这个select语句,我只得到一行,其中day=1,而我期望5天内有5行

select * from test_data where key = 'AX001';
对于这些陈述,我得到一个结果

select * from test_data where key = 'AX001' and day = 2;
select * from test_data where key = 'AX001' and day = 3;
但对于这一点,我只得到了一行,天数=2

select * from test_data where key = 'AX001' and day in (2,3);

你知道这种行为的原因是什么吗?

很明显,这里的解决方案是我解决的另一个问题

select * from test_table where key = 'AX001' and day in (1,2,3);

set hive.input.format=org.apache.hadoop.hive.ql.io.CombineHiveInputFormat; 
select * from test_table where key = 'AX001' and day in (1,2,3);

set hive.input.format=org.apache.hadoop.hive.ql.io.HiveInputFormat;
select * from test_table where key = 'AX001' and day in (1,2,3);

只有最后一个给了我3个结果。前两个只返回两行。

显然这里的解决方案,这是我解决的另一个问题

select * from test_table where key = 'AX001' and day in (1,2,3);

set hive.input.format=org.apache.hadoop.hive.ql.io.CombineHiveInputFormat; 
select * from test_table where key = 'AX001' and day in (1,2,3);

set hive.input.format=org.apache.hadoop.hive.ql.io.HiveInputFormat;
select * from test_table where key = 'AX001' and day in (1,2,3);

只有最后一个给我3个结果。前两个只返回两行。

什么版本的Hive?(每次发布都会出现很多bug…)您是否真的将
DAY
定义为字符串或整数?将(2,3)中的
和DAY替换为
和(DAY=2或DAY=3)
时会发生什么情况?Hive 0.13.1-CDH5.2.0..我在create table语句“PARTITED by(year int,month int,DAY int)”中将DAY定义为int。。(day=2或day=3)也给了我一行day=2。我刚刚尝试了day in(3,4,5),得到了day=3的一行。什么版本的蜂巢?(每次发布都会出现很多bug…)您是否真的将
DAY
定义为字符串或整数?将(2,3)
中的
和DAY替换为
和(DAY=2或DAY=3)
时会发生什么情况?Hive 0.13.1-CDH5.2.0..我在create table语句“PARTITED by(year int,month int,DAY int)”中将DAY定义为int。。(day=2或day=3)也给了我一行day=2。我刚刚尝试了(3,4,5)中的day,得到了day=3的一行。