>create table wordcount(line string);
#hadoop fs -mkdir /wcinput/
#hadoop fs -put input.txt /wcinput/
>load data inpath '/wcinput/' overwrite into table wordcount;
>desc wordcount;
>select * from wordcount;
>select split(line, ' ') from wordcount;
>select explode(split(line, ' ')) from wordcount;
>select explode(split(line, ' ')) as word from wordcount;
>select word,count(*) as count from (select explode(split(line, ' ')) as word from wordcount) w group by word;
>create table word_counts as select word, count(1) as count from (select explode(split(line, ' ')) as word from wordcount) w group by word order by word;
>select * from word_counts;
#hadoop fs -put ./sougou.dic /
#hadoop fs -ls /
>create table sougou (qtime string, qid string, qword string, url string) row format delimited fields terminated by ',';
>load data inpath '/sougou.dic' into table sougou;
>select count(*) from sougou;
>create table sougou_results as select keyword, count(1) as count from (select qword as keyword from sougou) t group by keyword order by count desc;
>select * from sougou_results limit 10;