【问题标题】:Why can't Amazon Redshift Parse this Valid JSON string?为什么 Amazon Redshift 无法解析此有效的 JSON 字符串?
【发布时间】:2014-10-12 23:32:08
【问题描述】:

我正在使用 Amazon Redshift 的 JSON 解析功能。大多数时候它可以工作,但在这种情况下它会失败。我收到以下错误:

error:  JSON parsing error
  code:      8001
  context:   invalid json object {"collection_id": 12, "activity_name": "Hour of Zen: The \"Dead Sea\" Float"}

我的印象是反斜杠是双引号的正确转义符(这是由 Python 的 JSON 包自动生成的)。

【问题讨论】:

标签: json amazon-redshift


【解决方案1】:

好的,根据this Redshift forum post,这是一个已知的错误,但没有 ETA 可以修复。论坛推荐这种解决方法:

替换:

json_extract_path_text(event_properties,'someValue')

与

json_extract_path_text(regexp_replace(event_properties,'\\\\.',''),'someValue')

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-11-28
    • 2017-02-03
    • 2017-02-04
    • 2020-03-22
    • 2022-08-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多