使用Hive从数组中的结构中选择特定字段

时间:2018-06-29 02:20:10

标签: hive hiveql

我的记录具有如下格式-

{
  "id": 1,
  "firstName": "Sanjay",
  "schools": [{
    "name": "School 1",
    "address": "Address 1",
    "type": "Type 1"
  },{
    "name": "School 2",
    "address": "Address 2",
    "type": "Type 2"
  }]}
}

如何仅选择以下字段-“ id”,“ schools.name”,“ schools.address”。基本上寻找一种使用以下模式选择记录的方法-

{
  "id": 1,
  "schools": [{
    "name": "School 1",
    "address": "Address 1"
  },{
    "name": "School 2",
    "address": "Address 2"
  }]}
}

尝试了几种方法,但没有一种有效。抱歉,这是一个小问题。

0 个答案:

没有答案