Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here. Want to know more about what has changed? Check out the Community News blog.

Hive create table

Highlighted

Hive create table

New Contributor

I have an hdfs location

 

 

/user/fms/log/part_key=2015-01-04/log1567838070

/user/fms/log/part_key=2015-01-04/log4930990119

 

/user/fms/log/part_key=2015-01-05/log1193648457

/user/fms/log/part_key=2015-01-05/log1euey79289

 

..

 

create external table webevent( col1 string , col2 string ..) 
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\001'
LINES TERMINATED BY '\n'
STORED AS TEXTFILE
LOCATION '/user/fms/log/'
;

 

not working . 

 

 

also i want the hive table to have the partition keys as well  on dt .

 

 

Please advise.

2 REPLIES 2

Re: Hive create table

Super Collaborator

Hi,

 

I guess you, at least, miss the part where you define the partition in the create table statement since your "log" folder seems to contains a partition on the field/key "part_key".

Re: Hive create table

Explorer

you need to alter table to add partitions in order to view data in partition folders.