【发布时间】:2020-07-14 11:43:41
【问题描述】:
我对雪花很陌生。我在 snowflake 中查询了一些 JSON 数据,尽管下面的 JSON 数组中有一个长字符串“元数据”,我需要从以下 JSON 对象中提取一些字段。
{
"metaData": "code:VALID_ERROR,message: the provided credentials
were not correct,type: ITEM_ERROR,exit_status: null,action_id: dax_123,
action_name: Queentech,
session_id: 678-902-6y78,type: null,
name: null,timestamp: 2020-07-11T20:52:59.158Z,timestamp_epoch_sec: 1594500779",
"statusId": "3478-901fg-u9710"
}
我给这个对象起了别名header。
我试过了
select header:statusId::varchar as statusid,
header.metadata.code ::varchar as code,
header.metadata.message::varchar as message
from test
where header:status_id ='3478-901fg-u9710'
我得到了代码和消息的 NULL 值。任何帮助,将不胜感激。 谢谢! 塔拉·帕尔默
}::variant 作为有效负载
【问题讨论】:
标签: snowflake-cloud-data-platform