1. 调整时区
用于调整时区为查询者的时区
-- clickhousetoString(toDateTime(event_time), 'Asia/Shanghai') AS event_time-- mysql howtoSELECT CONVERT_TZ('2020-04-06 02:00:00','UTC','Asia/Hong_Kong') as event_time
2. 提前Json中的字符串
通过 JSONExtractRaw对多层Json结构的数据进行 精准提取
-- clickhouseJSONExtractRaw(_data,'properties') as properties,JSONExtractRaw(JSONExtractRaw(_data,'properties'),'app_env') as app_env-- mysql howtojson_extract(_data,'$.properties') as properties,json_extract(json_extract(_data,'$.properties'),'$.app_env') as app_env
提取字符串,然后剔除双引号
""
-- clickhouseJSONExtractString(JSONExtractRaw(_data,'app_env')) as app_env-- mysqljson_unquote(json_extract(_data,'$.app_env')) as app_env
3. 判断字段不为空
使用在where条件中,判断字段 为空或者不为空
where1=1and notEmpty(client_version) --不为空and empty(app_version) --为空
