rcongiu / Hive-JSON-Serde

Read - Write JSON SerDe for Apache Hive.
Other
733 stars 393 forks source link

help me on how to access the fields #159

Closed rajkumarsowmy closed 7 years ago

rajkumarsowmy commented 8 years ago

Hi Creator, I have a question on how to access the nested Json block attributes in hive? I have created the table using the given table create tool. i would like to know how to access the attributes inside the categoryUsgaeDetail and SubCategoryUsageDetails without duplicates. since both are array elements. how to access individual elements out the arrays. thanks and appreciate your help !!

{ billDate: account: accountUsageDetails:{ totalCurrentUsage: categoryUsgaeDetail:[{ categoryDesc: SubCategoryUsageDetails:[{ categoryDesc: curentInfo:{usuageval:} previinfo:{usuageVal:} }] }] } }

categoryUsgaeDetail is an array field SubCategoryUsageDetails is an array field

rcongiu commented 8 years ago

{     billDate:     account:     accountUsageDetails:{         totalCurrentUsage:         categoryUsgaeDetail:[{             categoryDesc:             SubCategoryUsageDetails:[{                 categoryDesc:                 curentInfo:{usuageval:}                 previinfo:{usuageVal:}             }]         }]     } } select accountUsageDetails.categoryUsgaeDetails[0].categoryDesc, accountUsageDetails.categoryUsgaeDetails[0].SubCategoryUsageDetails[0].currentInfo.usuageval from ... ------------------------------------------------------- "Good judgment comes from experience.

Experience comes from bad judgment"

On Monday, August 29, 2016 11:02 AM, rajkumarsowmy <notifications@github.com> wrote:

Hi Creator, I have a question on how to access the nested Json block attributes in hive? I have created the table using the given table create tool. i would like to know how to access the attributes inside the categoryUsgaeDetail and SubCategoryUsageDetails without duplicates. since both are array elements. how to access individual elements out the arrays. thanks and appreciate your help !!{ billDate: account: accountUsageDetails:{ totalCurrentUsage: categoryUsgaeDetail:[{ categoryDesc: SubCategoryUsageDetails:[{ categoryDesc: curentInfo:{usuageval:} previinfo:{usuageVal:} }] }] } }categoryUsgaeDetail is an array field SubCategoryUsageDetails is an array field— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.