0
donutTest.json(在我的本地系统中的/ home/DEV)查询嵌入式JSON:错误使用Apache钻
{
"id":"0001",
"type":"donut",
"name":"Cake",
"batter":{
"id":"1001",
"type":"Regular"
},
"topping":[
{ "id":"5001", "type":"None"},
{ "id":"5002", "type":"Glazed"}
]
}
此查询工作正常。
select topping[0].id as topping_id, topping[3].type as topping_type from dfs.`/home/dev/donutTest.json`;
但当我:
select batter.id as batter_id, batter.type as batter_type from dfs.`/home/dev/donutTest.json`;
它的示值误差。
表 '连击' 未找到
topping[0]
和batter
都被嵌入文档还是错误。
为什么表格符号在顶部[0] .id的情况下不需要? –
这不是一个非常有启发性的答案,但它来自文档http://apache.github.io/drill/docs/json-data-model/#analyzing-json,它表示y,y [z]或y [z] .x引用不是不明确的,但Drill当前明确需要一个表前缀来引用另一个字段(tyz)内的字段。 – catpaws
@catpaws您的评论是有帮助的.... + 1为此 –