CREATE TABLE feedback_vnr(comments STRING);
load data LOCAL INPATH '/home/cloudera/Desktop/file.txt' INTO TABLE feedback_vnr;
select * from feedback_vnr;
select split(comments,' ') FROM feedback_vnr;
select explode(split(comments,' ')) FROM feedback_vnr
select word,count(*) from (select explode(split(comments,' ')) as word from feedback_vnr) tmp GROUP BY word;
load data LOCAL INPATH '/home/cloudera/Desktop/file.txt' INTO TABLE feedback_vnr;
select * from feedback_vnr;
select split(comments,' ') FROM feedback_vnr;
select explode(split(comments,' ')) FROM feedback_vnr
select word,count(*) from (select explode(split(comments,' ')) as word from feedback_vnr) tmp GROUP BY word;
No comments:
Post a Comment