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

Dav*_*veA 7 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"}
Run Code Online (Sandbox Code Playgroud)

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

Dav*_*veA 5

好的,根据这篇Redshift论坛帖子,这是一个知道错误,但没有ETA可以修复.论坛建议使用此解决方法:

更换:

json_extract_path_text(event_properties,'someValue')
Run Code Online (Sandbox Code Playgroud)

json_extract_path_text(regexp_replace(event_properties,'\\\\.',''),'someValue')
Run Code Online (Sandbox Code Playgroud)