I have a custom Pig loader like this:
A = LOAD 'myfile' USING myudf_loader()
A contains:
((key1, val1), (key2, val2), (key3, val3), ...)
That is A has an outer tuple that contains key-value pairs stored in inner tuples.
I am not using maps because maps require that key values within a relation must be unique. The keys I have do not necessarily have to be unique.
The keys are chararrays, while the values can be chararrays, ints, and floats.
I would like to access A's inner tuples, as well as the (key, value) pairs within those tuples.
For example, I want to FILTER the keys of A such that the only fields remaining are key = "city" and value = "New York City".
Example input:
DUMP A;
(("city", "New York City"), ("city", "Boston"),
("city", "Washington, D.C."), ("non-city-key", "non-city-value"),
("city", "New York City"), ("non-city-key", "non-city-value"))
Example output of the filtering, which is stored into B:
DUMP B;
("city", "New York City")
("city", "New York City")