0

I use flume to write data to hdfs,path like /hive/logs/dt=20151002.Then,i use hive to select data,but the count of response is always 0.

Here is my create table sql,CREATE EXTERNAL TABLE IF NOT EXISTS test (id STRING) partitioned by (dt string) ROW FORMAT DELIMITED fields terminated by '\t' lines terminated by '\n' STORED AS TEXTFILE LOCATION '/hive/logs'

Here is my select sql,select count(*) from test

1 Answer 1

1

It seems that you are not registering partition in hive meta-store. Although partition is present in hdfs path,Hive won't know it if its not registered in meta store. To register it you can do the following:

ALTER TABLE test ADD PARTITION (dt='20151002') location '/hive/logs/dt=20151002';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.