Hi Guys,
I have a JSON as the below structure where the key is as decimal.
{ "5.0": { "a": "15.92", "b": 0.0, "c": "15.92", "d": "637.14" }, "0.0": { "a": "15.92", "b": 0.0, "c": "15.92", "d": "637.14" } }
schema_of_json returns the following:
STRUCT<`0.0`: STRUCT<a: STRING, b: DOUBLE, c: STRING, d: STRING>, `5.0`: STRUCT<a: STRING, b: DOUBLE, c: STRING, d: STRING>>
I am facing an issue in extracting values against (a,b,c,d) for 5.0 and 0.0 in Databricks SQL. Following are the methods that I have tried, but still not able to extract value as it is coming NULL.
SELECT
data,
data:`5.0` as method1,
get_json_object(data, '$.`5.0`') as method2
FROM staging.consumables.test;
Can you guys please help?