Instantly share code, notes, and snippets.

Embed
What would you like to do?
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;
@Sundar1906

This comment has been minimized.

Show comment
Hide comment
@Sundar1906

Sundar1906 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???

Sundar1906 commented 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???

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