CREATE EXTERNAL TABLE test_table
(
`id` string,
`timestamp` timestamp,
`foo` string
) ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'
WITH SERDEPROPERTIES ("explicit.null"="true");
When querying using the JSON_EXTRACT_SCALAR functions the null is treated as a string "null" rather than null. For example the query below would return no results:
SELECT * FROM test_table WHERE JSON_EXTRACT_SCALAR(foo, '$.foo.key1') IS NULL
Given a JSON file:
Using the following table create:
When querying using the JSON_EXTRACT_SCALAR functions the null is treated as a string "null" rather than
null
. For example the query below would return no results:SELECT * FROM test_table WHERE JSON_EXTRACT_SCALAR(foo, '$.foo.key1') IS NULL