为什么Amazon Redshift无法解析此有效JSON字符串?

时间:2014-08-19 18:38:21

标签: json amazon-redshift

我正在使用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包自动生成的)。

1 个答案:

答案 0 :(得分:5)

好的,根据this Redshift forum post这是一个已知错误,但没有针对修复的ETA。论坛建议使用此解决方法:

替换:

json_extract_path_text(event_properties,'someValue')

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