why hive can‘t select data from hdfs when use partition? -
i use flume write data hdfs,path /hive/logs/dt=20151002
.then,i use hive select data,but count of response 0.
here create table sql,create external table if not exists test (id string) partitioned (dt string) row format delimited fields terminated '\t' lines terminated '\n' stored textfile location '/hive/logs'
here select sql,select count(*) test
it seems not registering partition in hive meta-store. although partition present in hdfs path,hive won't know if not registered in meta store. register can following:
alter table test add partition (dt='20151002') location '/hive/logs/dt=20151002';
Comments
Post a Comment