json_parse converts a JSON-formatted VARCHAR into the SUPER data type so you can query nested keys with dot and bracket notation.
json_parse converts a valid JSON string into the SUPER
type, letting you query semi-structured data with dot and bracket operators and PartiQL functions.
Call json_parse
inside COPY
, INSERT
, or UPDATE
to transform raw VARCHAR JSON into SUPER
as the data lands—saving storage and enabling instant analytics.
INSERT INTO products(id,name,price,stock,attributes)SELECT id,name,price,stock,json_parse(raw_json)FROM staging_products;
Use json_parse(value)
for conversion; pair with is_valid_json
to avoid errors. For legacy clusters, fall back to json_extract_path_text
on VARCHAR JSON.
Dot syntax (attributes.color
) accesses objects, while brackets (attributes['sizes'][0]
) traverse arrays. Combine with standard SQL filters for fast analytics.
json_extract_path_text(varchar_json,'key','subkey')
returns TEXT directly—handy when you only need a single attribute and SUPER support is unavailable.
Validate with is_valid_json
; store parsed data in dedicated SUPER columns; create late-binding views to shield BI tools; monitor storage because SUPER is compressed but still larger than pure columns.
Store dynamic product attributes (color, size, tags) in a SUPER column so front-end teams can add new keys without schema changes, while analysts still query them efficiently.
No. json_parse and the SUPER type require RA3 or newer node types. Upgrade or migrate older clusters to gain semi-structured support.
Call is_valid_json(raw_string). It returns true for well-formed JSON, allowing you to filter or log bad rows.
No. json_extract_path_text only accepts VARCHAR JSON. Use dot or bracket notation on SUPER data instead.