Hello Joao,
there is a small syntax error in the JSON schema. It works with
raws-events = load 'file:/[...]' using
JsonLoader('this:{(foo:chararray,baz:{(test:chararray)})},total:int');
Please note the added parentheses in in the schema for "baz".
Best Regards,
Dirk
On Thu, Aug 16, 2012 at 9:21 AM, Joao Salcedo <[email protected]> wrote:
> H <[email protected]>I All,
>
> I am using pig 0.10.0 I want to parse a json file and I am having the
> following error:
>
> raws-events = load 'file:/Users/joao.salcedo/Cloudera/test/test.json' using
> JsonLoader('this:{(foo:chararray,baz:{test:chararray})},total:int');
> 2012-08-16 17:15:05,687 [main] ERROR org.apache.pig.tools.grunt.Grunt -
> ERROR 1000: Error during parsing. Encountered " <PATH> "raws-events "" at
> line 2, column 1.
> Was expecting one of:
>
>
> my json file looks like
>
> cat test.json
> {"this":{"foo":"bar","baz":{"test":"me"},"total":"5"}}
>
>
> Any help is appreciated
>
> Cheers,
>
> Joao