Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sureshsaggar/5830183 to your computer and use it in GitHub Desktop.
Save sureshsaggar/5830183 to your computer and use it in GitHub Desktop.
Apache Pig - Convert bytearray(json) to bag or maps?
Here X contains one column named 'metadata' of type bytearray. But the actual content is a JSON i.e. the d is a JSON (keys as sId & cId) as shown below:
grunt> describe X
X: {metadata: bytearray}
grunt> dump X
({"sId":"003_w","cId":"k"})
({"sId":"001_rf","cId":"r"})
({"sId":"001_rf","cId":"r"})
({"sId":"004_rf","cId":"r"})
Any idea how can I generate cId & sId as separate chararray columns?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment