I would like to load a JSON file containing records of the following format:

{
   "area": "ABC",
   "date_day": 1,
   "date_hour": 0,
   ...
   "energy": [["17-16", 1], ["18-17", 2]]
}

The "energy" property represents a sparse matrix. It's a list with an
arbitrary number of key-value-pairs (minimum 1). The first element (string)
is the matrix unit key, the second element is the value.

I need both key and value in order to summarize values with matching keys
in my pig job. I understand that it should be possible to import this as a
bag. Correct?

Can anybody tell me how the schema definition passed to the
built-in JsonLoader function should look like?

Thanks in advance!

Marian

Reply via email to