Skip to content
Snippets Groups Projects
Commit 03f57a6c authored by Yury Liavitski's avatar Yury Liavitski Committed by Sean Owen
Browse files

Fixing the type of the sentiment happiness value

## What changes were proposed in this pull request?

Added the conversion to int for the 'happiness value' read from the file. Otherwise, later on line 75 the multiplication will multiply a string by a number, yielding values like "-2-2" instead of -4.

## How was this patch tested?

Tested manually.

Author: Yury Liavitski <seconds.before@gmail.com>
Author: Yury Liavitski <yury.liavitski@il111.ice.local>

Closes #11540 from heliocentrist/fix-sentiment-value-type.
parent 4b13896e
No related branches found
No related tags found
No related merge requests found
......@@ -56,8 +56,8 @@ object TwitterHashTagJoinSentiments {
val wordSentimentFilePath = "data/streaming/AFINN-111.txt"
val wordSentiments = ssc.sparkContext.textFile(wordSentimentFilePath).map { line =>
val Array(word, happinessValue) = line.split("\t")
(word, happinessValue)
} cache()
(word, happinessValue.toInt)
}.cache()
// Determine the hash tags with the highest sentiment values by joining the streaming RDD
// with the static RDD inside the transform() method and then multiplying
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment