我们用案例来看下两者之间的区别
解析数据格式:
{"total":"5","success":"1","translate_status":"0","success_pos_list":"4","fail_pos_list":"0,1,2,3","batch_id":"2022120100"}
解析sql
select
json_extract_scalar(xx_info,'$.translate_status') as scalar_translate_status,
json_extract(xx_info,'$.translate_status') as extract_translate_status
from edw.scratch.table
scalar_translate_status | extract_translate_status |
---|---|
0 | “0” |