E&ICT IIT Roorkee - Data Engineering Course at Rs. 1,999 (90% OFF) | Expires in

 Enroll Now

Hive - Project

9 / 17

In this step, we calculate the sentiment of each tweet. We create the new table _tweets_sentiment_ which groups the tweets of _l3_ view on the basis of id, sums up the polarity of each word and assign each tweet a sentiment label such as positive, negative or neutral.


  1. Create _tweets_sentiment_ table. Each row of _tweets_sentiment_ table stores the sentiment of the tweet. Run below command in the Hive query editor in Hue

    create table tweets_sentiment stored as orc as select 
    when sum( polarity ) > 0 then 'positive' 
    when sum( polarity ) < 0 then 'negative'  
    else 'neutral' end as sentiment 
    from l3 group by id;

    Sample rows of _tweets_sentiment_ table are


What is the sentiment of tweet with id as 330043911940751360?