pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Russell Jurney <russell.jur...@gmail.com>
Subject Informal Code Review for ToJson(Tuple, Bag)
Date Wed, 26 Sep 2012 20:54:48 GMT
I'm wanting to get this into piggybank sometime, so I figure to post it
here before blogging about it tomorrow. If anyone had a minute for code
review, I'd appreciate it.

https://github.com/rjurney/pig-to-json/blob/master/src/com/hortonworks/pig/udf/ToJson.java

I needed this to store bags of tuples in Redis, because the
pig-redis<https://github.com/mattb/pig-redis>driver doesn't support
complex types. The one thing it doesn't do that
maybe it should is to be able to serialize fields into simple objects with
name/value, like:

B = foreach A generate ToJson(my_simple_field) -> {"my_simple_field": value}

At the moment that just returns: value

Also, is there an issue with the name? I could name it ToSimpleJson since
it isn't respecting Pig types beyond numeric/string types in javascript, if
we had a ToJson that produced a schema chunk a well.

-- 
Russell Jurney twitter.com/rjurney russell.jurney@gmail.com datasyndrome.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message