我正在使用Presto(0.163)来查询数据,并试图从json中提取字段。JSON_EXTRACT在Presto中包含''字符的问题
我有这样一个下面给出,这是存在于列“style_attributes”一个JSON:
"attributes": {
"Brand Fit Name": "Regular Fit",
"Fabric": "Cotton",
"Fit": "Regular",
"Neck or Collar": "Round Neck",
"Occasion": "Casual",
"Pattern": "Striped",
"Sleeve Length": "Short Sleeves",
"Tshirt Type": "T-shirt"
}
我无法提取字段“短袖”。 以下是我正在使用的查询:
从表中选择JSON_EXTRACT(style_attributes,'$。属性.Sleeve长度')作为长度;
查询失败,出现以下错误 - 无效的JSON路径:“$ .attributes.Sleeve长度”
对于字段,而'“(空间),查询运行良好。
我试图在Presto文档中找到解决方案,但没有成功。
这有帮助。谢谢。 –
不客气。附:不要忘记接受答案 –