0
{"query":"32 gb memory card and pen drive","queryObj":{"32 Gb memory card and Pen drive":34359738368,"32 gb memory card and pen drive":6872838602707},"implicitIntent":[],"textualIntent":[{"attributes":{"attributes":[{"field":{"name":"store"},"value":"Memory Cards & Readers","properties":{"storeId":"zzf","storePath":"tyy/4mr/zzf","isLeaf":false}} ]}}]}

I want query and field-name and value for this json using pig. So I have written following script:

G = LOAD 'quattr.json' USING JsonLoader('query:chararray, textualIntent: {(attributes:(attributes:{(field: (name:chararray),value:chararray)}))}') ;

but this giving only query output, not other two fields:

(32 gb memory card and pen drive,)

May anyone help to figure out problem? Thanks

piyush-balwani
  • 524
  • 3
  • 15
  • 1
    The schema given to JsonLoader must match all the fields in the same order as in the data. – franklinsijo Jan 25 '17 at 08:45
  • @franklinsijo Can we give first starting required fields in order, if we didn't requires last fields. – piyush-balwani Jan 25 '17 at 13:15
  • No, It is not possible with JsonLoader. For such scenario, you can try [elephant-bird](https://github.com/twitter/elephant-bird) – franklinsijo Jan 25 '17 at 13:19
  • @franklinsijo Thanks. facing problem in using elephant-bird. [problem](http://stackoverflow.com/questions/41864815/elephantbird-registered-still-showing-error-2998). – piyush-balwani Jan 26 '17 at 02:11

0 Answers0