Created
September 14, 2014 09:47
-
-
Save Arnonrgo/ea39f45ee35176e7656f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val data = sc.textFile("src/test/resources/*.csv") | |
val calls = data.map (Call(_)).cache() | |
val hourlyPairs = calls.map(c => (c.getHourly,c)) | |
val weeklyPairs = calls.map(c => (c.getWeekly,c)) | |
val groupedHourly = hourlyPairs.groupByKey() | |
val groupedWeekly = weeklyPairs.groupByKey() | |
val hourlyAggregates = groupedHourly.values.map(g => (null,CalcAggregations(g))) | |
val weeklyAggregates = groupedWeekly.values.map(g => (null,CalcAggregations(g))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment