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
Make this protected and static.