【发布时间】:2016-09-23 18:01:30
【问题描述】:
如果它是一个非常基本的,请不要介意:
test.txt
1 拉维 100 液压
2 克里希纳 200 水力
3 fff 300 秒
我在 hive 中创建了一个表,并在 city 上进行了分区,并加载了如下数据:
create external table temp(id int, name string, sal int)
partitioned by(city string)
location '/testing';
load data inpath '/test.txt' into table temp partition(city='hyd');
在 HDFS 中,结构是 /testing/temp/city=hyd/test.txt
当我查询表为“select * from temp”时;
输出:
temp.id temp.name temp.sal temp.city
1 ravi 100 hyd
2 krishna 200 hyd
3 fff 300 hyd
我的问题是,为什么第三行的“sec”中的城市名称在输出中变为“hyd”?
我有什么问题吗?
提前致谢!!!
【问题讨论】:
标签: hadoop hive hiveql hadoop2