Apache Spark application to calculate the relevance of each word from a list of phrases

The following Apache Spark application wrote in Scala calculates the relevance of each word from a list of phrases using a initial weight value for each phrase.
Continue reading “Apache Spark application to calculate the relevance of each word from a list of phrases”

Add and subtract days from a timestamp in Java / Scala

The following function adds the days indicated in the days argument (positive or negative integer value) to the timestamp passed through the date argument. The function expects the timestamp input format indicated in the inputFormat argument and returns the new timestamp resulting from the addition or subtraction with the format indicated in the outputFormat argument (format example: “yyyyMMdd”).

Continue reading “Add and subtract days from a timestamp in Java / Scala”