v.19.8Improvements
Added Functions Jsonextractraw, Jsonextractkeyandvalues
Added functionsJSONExtractRaw,JSONExtractKeyAndValues. Renamed functionsjsonExtract<type>toJSONExtract<type>. When something goes wrong these functions return the correspondent values, notNULL. Modified functionJSONExtract, now it gets the return type from its last parameter and does not inject nullables. Implemented fallback to RapidJSON in case AVX2 instructions are not available. Simdjson library updated to a new version. #5235 (Vitaly Baranov)
Why it matters
These enhancements improve JSON parsing robustness and consistency in ClickHouse by providing new utility functions, better error handling that avoidsNULL results on failure, and compatibility across different CPU architectures by falling back to RapidJSON if AVX2 is unsupported. This ensures more reliable JSON data processing and easier use of JSON functions.How to use it
Use the new functionsJSONExtractRaw to retrieve raw JSON data and JSONExtractKeyAndValues to extract keys and values from JSON. Replace calls to old jsonExtract<type> functions with the renamed JSONExtract<Type> variants. When using JSONExtract, provide the desired return type as the last argument to avoid nullable injection. The fallback to RapidJSON and simdjson update happen transparently without user intervention.