Let's say I have a set of tuples to be processed by Cascalog, formatted like [Date, Name, Value]
, e.g.
2014-01-01 Pizza 3
2014-01-01 Hamburger 4
2014-01-01 Cheeseburger 2
2014-01-02 Pizza 1
2014-01-02 Hamburger 2
Given that I have a list of columns like [Pizza, Hamburger, Cheeseburger]
, I want to transpose / pivot the data so it looks like this:
Date Pizza Hamburger Cheeseburger
2014-01-01 3 4 2
2014-01-02 1 2 0
What's the best way to do this in Cascalog?