Create a gist now

Instantly share code, notes, and snippets.

Embed
Word count using Hive
Hello
World
Bye
World
CREATE TABLE words(word STRING);
LOAD DATA LOCAL INPATH 'C:\Temp\wordcount\InputData.txt' OVERWRITE INTO TABLE words;
SELECT word, count(*) FROM words GROUP BY word;
@SundarHadoopDeveloper

This comment has been minimized.

Show comment
Hide comment
@SundarHadoopDeveloper

SundarHadoopDeveloper May 19, 2018

Hi, The WordCount is working fine, but its consider whole line as a Word, if i want to count the words in each line then what is the HQL query???

Hi, The WordCount is working fine, but its consider whole line as a Word, if i want to count the words in each line then what is the HQL query???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment