CREATE TABLE tmp_json (c_json text DEFAULT NULL);
INSERT INTO tmp_json VALUES('{"type":null}');
SELECT
JSON_EXTRACT(c_json,'$.type') ext,
CASE WHEN JSON_EXTRACT(c_json,'$.type') IS NULL THEN 1
WHEN JSON_EXTRACT(c_json,'$.type') = NULL THEN 2
WHEN JSON_EXTRACT(c_json,'$.type') = '' THEN 3
WHEN JSON_EXTRACT(c_json,'$.type') = 'null' THEN 4
ELSE 0 END flag
FROM tmp_json