Pig default JsonLoader schema issue

后端 未结 1 1521
小鲜肉
小鲜肉 2021-01-24 08:49

I\'ve the below data that need to be parsed using Pig

Data

{
    \"Name\": \"BBQ Chicken\",
    \"Sizes\": [
        { \"Size\": \"Large         


        
相关标签:
1条回答
  • 2021-01-24 09:19

    You have two options here : if the number of items in the array in unknown.

    Toppings:{t:(i:chararray)}
    

    Or if the number of elements going to be same allways.

    Toppings: (i: chararray, j: chararray, k: chararray)
    

    will give you output :

    (BBQ Chicken,{(Large,14.99),(Medium,12.99)},)
    
    0 讨论(0)
提交回复
热议问题