Support date partitioning with JSON data.

Commit message says it all.

I also updated the Thrift code to support fields other than `timestamp`.

CC @pgarbacki @andykram
You could make this abstract and protected.