I have a table in Databricks that has a column (called "properties") which contains JSON data. I've successfully used get_json_object() in a SparkSql notebook to retrieve properties from it like so:
%sql
select distinct_id, get_json_object(properties, "$.time")
from my_table
This works well. However, there are sub-properties in the properties column that have asterisks in their names, e.g. *Plan. Accessing these properties in the standard way, e.g. $.*Plan doesn't work, since * has special meaning for get_json_object(). I've tried accessing these properties using escape chars, like so:
%sql
select distinct_id, get_json_object(properties, "$.\*Plan")
from my_table
... along with alternative escapes, but to no avail. Is there a way to extract JSON sub-properties that can escape the asterisk?
Thanks!