Hive - Project

4 / 14
Hive - Project - Sentiment Analysis - Step - 3

The objective of this step is to create an external table dictionary. This table contains English words and their polarity. Polarity means if the word has positive, negative, or neutral sentiment. Since a tweet consists of words, this table will help us in calculating the sentiment of the entire tweet.

Steps-

  1. Create an external table dictionary. Run below command in Hive query editor in Hue. Replace YOUR_USER_NAME with your CloudxLab username. dictionary table contains words and their polarity.

    CREATE EXTERNAL TABLE dictionary (
    type string,
    length int,
    word string,
    pos string,
    stemmed string,
    polarity string
    )
    ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' 
    STORED AS TEXTFILE
    LOCATION '/user/YOUR_USER_NAME/SentimentFiles/SentimentFiles/upload/data/dictionary';
    

    Sample rows of dictionary table are

Question-

How many rows are there in dictionary table?

  • 5000
  • 7985
  • 8221