Skip to content

Instantly share code, notes, and snippets.

@pawelpabich
Created January 1, 2013 09:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pawelpabich/4426172 to your computer and use it in GitHub Desktop.
Save pawelpabich/4426172 to your computer and use it in GitHub Desktop.
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
Copy link

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