我有需要解析的json,但问题是json的字符串值有一个单引号
{'name': None, 'medium': 'organic', 'source': 'google-play'}
有没有办法在clickhouse中解析这个?谢谢
这不是一个单引号的JSON,它只是JSON Dict的打印格式。但是您可以将其转换为JSON:
SELECT JSONExtractString(
replaceAll(
replaceAll(
'{''name'': None, ''medium'': ''organic'', ''source'': ''google-play''}', '''', '"'
), 'None', 'null'
), 'medium'
)