Skip to content

Instantly share code, notes, and snippets.

@Sundar1906
Created May 19, 2018 17:07
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 Sundar1906/1683849144eb1189f8e8c56ca65bfd05 to your computer and use it in GitHub Desktop.
Save Sundar1906/1683849144eb1189f8e8c56ca65bfd05 to your computer and use it in GitHub Desktop.
WordCount in Hive Query
CREATE TABLE Wcount(words STRING);
LOAD DATA LOCAL INPATH '/home/skumares/InputData.txt' OVERWRITE INTO TABLE Wcount;
Select wc,count(*) from(Select explode(split(words,' ')) from Wcount) p group by wc;
Hello Hive Users
Hello Boss
let us create the Word Count Input file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment