我的配置单元代码中有一个问题。我想提取JSON数据使用HIVE.Following为样本JSON格式使用HIVE从JSON中提取字段
{"Rtype":{"ver":"1","os":"ms","type":"ns","vehicle":"Mh-3412","MOD":{"Version":[{"versionModified"{"machine":"123.dfer","founder":"3.0","state":"Florida","fashion":"fg45","cdc":"new","dof":"yes","ts":"2000-04-01T00:00:00.171Z"}}]}}}
我希望得到以下领域
- 版本
- 型
- 车辆
- TS
- 创始人
- 状态
问题是创始人和国家是在一个阵列“版本” 任何人都可以帮助如何摆脱这一点? 一些时间,而不是别的versionmedified东西可能会
如: 有些时候我的数据会是怎样
{"Rtype":{"ver":"1","os":"ms","type":"ns","vehicle":"Mh-3412","MOD":{"Version":[{"anotherCriteria":{"engine":"123.dfer","developer":"3.0","state":"Florida","fashion":"fg45","cdc":"new","dof":"yes","ts":"2000-04-01T00:00:00.171Z"}}]}}}
添加下面的一些样本数据:
{"Rtype":{"ver":"1","os":"ms","type":"ns","vehicle":"Mh-3412","MOD":{"Version":[{"ABC"{"XYZ":"123.dfer","founder":"3.0","GHT":"Florida","fashion":"fg45","cdc":"new","dof":"yes","ts":"2000-04-01T00:00:00.171Z"}}]}}}
{"Rtype":{"ver":"1","os":"ms","type":"ns","vehicle":"Mh-3412","MOD":{"Version":[{"GAP"{"XVY":"123.dfer","FAH":"3.0","GHT":"Florida","fashion":"fg45","cdc":"new","dof":"yes","ts":"2000-04-01T00:00:00.171Z"}}]}}}
{"Rtype":{"ver":"1","os":"ms","type":"ns","vehicle":"Mh-3412","MOD":{"Version":[{"BOX"{"VOG":"123.dfer","FAH":"3.0","FAX":"Florida","fashion":"fg45","cdc":"new","dof":"yes","ts":"2000-04-01T00:00:00.171Z"}}]}}}
我需要把这个数据基于版本的各种表格如果它是“BOX”放在一个表中如果它是“GAP”把另一个表...
指这在蜂巢使用get_json_object .. ..http://stackoverflow.com/questions/24447428/parse-json-arrays-using-hive –
请显示您的表架构 –
不要混淆问题。为INSERTissue –