Shape / columns · All operations
Parse nested values
Parse or build JSON, XML, URL, key-value, nested structs and lists.
Status
- In arcform
Runs as a SQL step
arcform carries it as a
sql:step today.- Shape of the result
- one row out per row in, with columns added or changed
- Level
- one clause of SQL
The DuckDB step
Read fields out of JSON
It reads the orders table the proofs share. Create it first:
CREATE TABLE orders AS SELECT * FROM (VALUES
(1, 'Alice Ng', 'north', DATE '2026-01-03', 120.00, 'widget', 'a|b', '{"channel":"web","items":[1,2]}'),
(2, 'alice ng', 'north', DATE '2026-01-05', 80.50, 'gadget', 'b', '{"channel":"shop","items":[3]}'),
(3, 'Bob Okafor', 'south', DATE '2026-01-05', 300.00, 'widget', 'a|c', '{"channel":"web","items":[4,5,6]}'),
(4, 'Carla Díaz', 'east', DATE '2026-01-09', NULL, 'gizmo', NULL, '{"channel":"web","items":[]}'),
(5, 'Bob Okafor', 'south', DATE '2026-01-12', 45.25, 'gadget', 'c', '{"channel":"phone","items":[7]}'),
(6, 'Dev Patel', 'west', DATE '2026-01-12', 510.00, 'widget', 'a', '{"channel":"web","items":[8,9]}'),
(7, 'Carla Diaz', 'east', DATE '2026-01-20', 99.99, 'gizmo', 'b|c', '{"channel":"shop","items":[10]}'),
(8, 'Dev Patel', 'west', DATE '2026-02-02', 510.00, 'widget', 'a', '{"channel":"web","items":[8,9]}'),
(9, 'Eve Larsen', NULL, DATE '2026-02-03', 15.00, 'gadget', NULL, '{"channel":"web","items":[11]}'),
(10, 'Alice Ng', 'north', DATE '2026-02-10', 220.00, 'gizmo', 'a|b|c', '{"channel":"phone","items":[12,13]}')
) t(order_id, customer, region, order_date, amount, product, tags, meta);Then run the statement:
CREATE TEMP TABLE result AS
SELECT order_id, meta->>'channel' AS channel, json_array_length(meta->'items') AS n_items,
from_json(meta, '{"channel":"VARCHAR","items":["INTEGER"]}') AS typed
FROM orders;
SELECT * FROM result;
SELECT CASE WHEN ((SELECT sum(n_items) = 15 AND count(*) FILTER (WHERE channel = 'web') = 6 AND max(typed.items[3]) = 6 FROM result)) THEN 'as expected' ELSE error('the JSON fields did not come out as 15 items, 6 web orders and a typed list') END AS verdict;- It needs nothing installed beyond DuckDB itself.
- The statement checks its own result and raises an error when it is wrong: “the JSON fields did not come out as 15 items, 6 web orders and a typed list”.
- It passed on DuckDB
v2.0.0 (Cyanoptera) d54cbbe3df.
Variants
- Convert a document between formats
Turn a JSON, XML, HTML or EDIFACT document into the same content in another of those formats.
- Extract values by path
Pull the values at chosen JSON paths, XPaths or field names out of a nested column into new columns.
- Spread nested fields into columns
Lift every field of a struct or object column into its own top-level column, one row still per row.
- Work with list values
Test, index, sort, filter, combine or summarise the elements inside list and array values.
- Work with map values
Build maps, look up a key, list keys or values, and merge maps.
- Pack columns into a nested value
Combine several columns of each row into one struct, list, JSON, XML or Avro column.
- Write a nested value as text
Turn a struct, list or JSON value back into a JSON text string.
- Restructure a document with a transform language
Rewrite a JSON or XML document with a stylesheet, patch or transform program such as XSLT, a JSON patch or jq.
- Split a URL into its parts
Extract the host, path, query parameters or other parts of a URL, or encode and decode URL text.
Combine rows into one nested value
Gather the values of many rows into a single JSON, XML or list value.
Decode log, network and binary records
Parse syslog, HL7, email header, NetFlow, IP, Avro or binary payloads into separate fields.
Other nested-value functions
General nested-type support and function families that mix building, reading and editing structs and unions.
Parse text into a nested value
Turn a text column holding JSON, XML or key-value pairs into a typed nested value in the same column.
Turn a nested document into table rows
Expand a JSON or XML document, or a list of records, into a table with one row per record or element.
What other tools call it
Meridian's classification; an independent blind rating agreed on 86.2% of 312 rows (exact class, version 2).
Alteryx Designer (3)
JSON Buildread 2026-09-27Rebuild JSON text from the name and value rows of JSON Parse
JSON Parseread 2026-09-27Split JSON text into name and value rows for downstream processing
XML Parseread 2026-09-27Parse XML text into individual fields
Apache DataFusion (7)
Array Functionsread 2026-09-27123 functions, 67 of them aliases: array_append, array_sort, flatten, array_distance, string_to_array, …
Field access (col['field'] and col[1])read 2026-09-27Index into struct fields and list elements
Map Functionsread 2026-09-276 functions, 1 of them aliases: map, map_keys, map_values, map_entries, map_extract, …
Struct Functionsread 2026-09-273 functions, 1 of them aliases: named_struct, row, struct
Support for nested types (ARRAY/LIST and STRUCT)read 2026-09-27Read and write columns holding arrays, lists and structs
Union Functionsread 2026-09-272 functions: union_extract, union_tag
unnest (struct)read 2026-09-27Expand the fields of a struct into individual columns
Apache Hop (7)
Add XMLread 2026-09-27Encode several fields of a row as an XML fragment in a new string column
Avro decoderead 2026-09-27Decode an Avro record column into separate typed fields
Avro encoderead 2026-09-27Encode chosen fields into a single Avro record column
Edi to XMLread 2026-09-27Convert EDIFACT message text to generic XML
XML Joinread 2026-09-27Insert XML fragments from one stream into a target XML document from another
XSL pipelineread 2026-09-27Transform XML files with an XSL stylesheet into XML, HTML or text
XSL transformationread 2026-09-27Apply an XSL stylesheet to XML held in a field or file
Apache NiFi (15)
AttributesToCSVread 2026-09-27Serialise FlowFile attributes as a CSV line, written to an attribute or to content
AttributesToJSONread 2026-09-27Serialise FlowFile attributes as a JSON object, written to an attribute or to content
EvaluateJsonPathread 2026-09-27Evaluate JsonPath expressions against JSON content; results go to attributes or replace content
EvaluateXPathread 2026-09-27Evaluate XPath expressions against XML content; results go to attributes or replace content
EvaluateXQueryread 2026-09-27Evaluate XQuery expressions against XML content; results go to attributes or replace content
ExtractEmailHeadersread 2026-09-27Extract the headers of an email into FlowFile attributes
ExtractHL7Attributesread 2026-09-27Extract the segments and fields of an HL7 message into FlowFile attributes
FlattenJsonread 2026-09-27Flatten a nested JSON document into single-level keys joined by a separator
JSLTTransformJSONread 2026-09-27Transform JSON content with a JSLT transformation
JoltTransformJSONread 2026-09-27Restructure JSON content with a Jolt transform specification
JoltTransformRecordread 2026-09-27Apply a Jolt specification to each record of a FlowFile
ParseNetflowv5read 2026-09-27Parse NetFlow v5 bytes into attributes or JSON content
ParseSyslogread 2026-09-27Parse an RFC 5424 or RFC 3164 syslog message into attributes
ParseSyslog5424read 2026-09-27Parse an RFC 5424 syslog message, including structured data, into attributes
TransformXmlread 2026-09-27Apply an XSLT stylesheet to XML content
Apache SeaTunnel (1)
JsonPathread 2026-09-27Extract values from a JSON field by JsonPath into new typed fields
AWS Glue (7)
Extract JSON pathread 2026-09-27Extract new columns from a JSON string column
Flattenread 2026-09-27Lift the fields inside structs to top-level fields
Parse JSON columnread 2026-09-27Parse a string column holding JSON into a struct or array column
Simplify_ddb_jsonread 2026-09-27Simplify nested columns that are in the DynamoDB JSON structure
Unboxread 2026-09-27Parse a string field that holds formatted data, such as JSON, into a struct
UnnestFrameread 2026-09-27Flatten nested objects to top-level fields and generate join keys for array objects
unnest_ddb_jsonread 2026-09-27Flatten nested columns that are in the DynamoDB JSON structure
Azure Data Factory (5)
Array functionsread 2026-09-2720 functions: array, at, contains, distinct, except, …
Collection functionsread 2026-09-2710 functions: contains, empty, first, intersection, join, …
Map functionsread 2026-09-274 functions: associate, keyValues, mapAssociation, reassociate, …
Parseread 2026-09-27Parse string columns that hold JSON, delimited text or XML
Stringifyread 2026-09-27Turn complex-typed columns into plain strings
Bruin (3)
bruin.get_url_host(field)read 2026-09-27Emit an expression extracting the host from a URL string
bruin.get_url_parameter(field, parameter)read 2026-09-27Emit an expression extracting one query parameter value from a URL string
bruin.get_url_path(field)read 2026-09-27Emit an expression extracting the path, without query parameters, from a URL string
dbt-utils (4)
Array functionsread 2026-09-273 macros: array_append, array_concat, array_construct
get_url_hostread 2026-09-27Extract the hostname from a URL column
get_url_parameterread 2026-09-27Extract a named query parameter from a URL column
get_url_pathread 2026-09-27Extract the page path from a URL column
DuckDB (6)
Array Functions (family)read 2026-09-27The functions documented on the Array Functions page
List Functions (family)read 2026-09-27The functions documented on the List Functions page
Map Functions (family)read 2026-09-27The functions documented on the Map Functions page
Nested Functions (family)read 2026-09-27The functions documented on the Nested Functions page
Struct Functions (family)read 2026-09-27The functions documented on the Struct Functions page
Union Functions (family)read 2026-09-27The functions documented on the Union Functions page
Duckle (12)
Array Distinctread 2026-09-25distinct elements of a list
Array Lengthread 2026-09-25length of a list
Containsread 2026-09-25boolean column: does the list contain a value
Element Atread 2026-09-25element of a list by index
Flattenread 2026-09-25flatten nested JSON into columns
IP Parseread 2026-09-25extract host, family, netmask or broadcast from IP or CIDR text
JSONPath Extractread 2026-09-25extract a value by JSON path
Merge Objectsread 2026-09-25merge JSON objects
Parse JSONread 2026-09-25parse JSON text
Stringify JSONread 2026-09-25serialise a value to JSON text
URL Parseread 2026-09-25extract scheme, host, port, path, query or fragment from a URL by regex
jq Filterread 2026-09-25transform a JSON column with a jq program
EasyMorph (7)
Construct JSONread 2026-09-27Build a JSON object from table values
Extract JSON propertiesread 2026-09-27Pull the values at given JSON paths into columns
Modify JSONread 2026-09-27Delete, replace or rename a JSON property, or reformat the JSON (paid editions only)
Parse JSONread 2026-09-27Turn a JSON object into a table
Parse XMLread 2026-09-27Turn XML into a table
Parse web form submissionread 2026-09-27Decode x-www-form-urlencoded form submissions into fields
XSLT transformationread 2026-09-27Apply XSLT stylesheets to an XML file on disk; the in-memory table is untouched
Ibis (49)
Arrayread 2026-09-27Build an array value from a list of expressions
ArrayAllread 2026-09-27Test whether every element of a boolean array is true
ArrayAnyread 2026-09-27Test whether any element of a boolean array is true
ArrayConcatread 2026-09-27Join two or more arrays end to end
ArrayContainsread 2026-09-27Test whether an array holds a given value
ArrayDistinctread 2026-09-27Reduce an array to its unique elements
ArrayFilterread 2026-09-27Keep the array elements for which a lambda is true
ArrayFlattenread 2026-09-27Remove one level of nesting from an array of arrays
ArrayIndexread 2026-09-27Get the array element at a given index
ArrayIntersectread 2026-09-27Keep the elements two arrays have in common
ArrayLengthread 2026-09-27Count the elements of an array
ArrayMapread 2026-09-27Apply a lambda to every element of an array
ArrayMaxread 2026-09-27Largest element of each array
ArrayMeanread 2026-09-27Mean of the elements of each array
ArrayMinread 2026-09-27Smallest element of each array
ArrayModeread 2026-09-27Most frequent element of each array
ArrayPositionread 2026-09-27Find the index of a value within an array
ArrayRemoveread 2026-09-27Drop every occurrence of a value from an array
ArrayRepeatread 2026-09-27Repeat the elements of an array a given number of times
ArraySliceread 2026-09-27Take a start-to-stop slice of an array
ArraySortread 2026-09-27Sort the elements of an array
ArrayStringJoinread 2026-09-27Join the strings of an array into one string with a separator
ArraySumread 2026-09-27Sum of the elements of each array
ArrayUnionread 2026-09-27Combine two arrays, keeping the distinct elements
ArrayZipread 2026-09-27Zip arrays element by element into an array of structs
ExtractAuthorityread 2026-09-27Extract the authority from a URL
ExtractFileread 2026-09-27Extract the file part from a URL
ExtractFragmentread 2026-09-27Extract the fragment from a URL
ExtractHostread 2026-09-27Extract the host from a URL
ExtractPathread 2026-09-27Extract the path from a URL
ExtractProtocolread 2026-09-27Extract the protocol from a URL
ExtractQueryread 2026-09-27Extract the query string, or one named parameter of it, from a URL
ExtractUserInforead 2026-09-27Extract the user info from a URL
JSONGetItemread 2026-09-27Get a value from a JSON object by key, or from a JSON array by index
Mapread 2026-09-27Build a map from an array of keys and an array of values
MapContainsread 2026-09-27Test whether a map has a given key
MapGetread 2026-09-27Look up a map value by key, with a default when the key is absent
MapKeysread 2026-09-27Keys of a map as an array
MapLengthread 2026-09-27Count the keys of a map
MapMergeread 2026-09-27Combine two maps into one; on a shared key the value from the first map is kept
MapValuesread 2026-09-27Values of a map as an array
StructColumnread 2026-09-27Build a struct column from named expressions
StructFieldread 2026-09-27Extract one named field from a struct value
ToJSONArrayread 2026-09-27Convert a JSON value into an array of JSON values
ToJSONMapread 2026-09-27Convert a JSON value into a map from string keys to JSON values
UnwrapJSONBooleanread 2026-09-27Extract a JSON boolean as a native boolean
UnwrapJSONFloat64read 2026-09-27Extract a JSON number as a native 64-bit float
UnwrapJSONInt64read 2026-09-27Extract a JSON number as a native 64-bit integer
UnwrapJSONStringread 2026-09-27Extract a JSON string as a native string
KNIME Analytics Platform (20)
Column to XMLread 2026-09-27Build one XML element per row from column values, with custom name and attributes
Columns to Collectionread 2026-09-27Collect several columns into one list or set column
Columns to JSONread 2026-09-27Build one JSON object per row from selected columns
JSON Column Combinerread 2026-09-27Combine several JSON columns into one JSON column
JSON Diffread 2026-09-27Compute a JSON patch describing the difference between two JSON columns
JSON Pathread 2026-09-27Extract values from a JSON column by JSONPath queries into new columns
JSON Path (Dictionary)read 2026-09-27Extract JSON values using JSONPath queries supplied in a second table
JSON Row Combinerread 2026-09-27Combine the JSON values of all rows into a single JSON value
JSON Transformerread 2026-09-27Apply a JSON patch or merge patch to a JSON column
JSON to Tableread 2026-09-27Flatten a JSON column into columns by inferring its structure
JSON to XMLread 2026-09-27Convert JSON values to XML documents
Nominal Probability Distribution Creatorread 2026-09-27Pack probability columns, or one-hot a string column, into a probability-distribution cell
String to JSONread 2026-09-27Parse string values into JSON values
String to XMLread 2026-09-27Parse string values into XML values
Table to JSONread 2026-09-27Convert selected columns into a single JSON value, row-wise or column-wise
XML Column Combinerread 2026-09-27Merge several XML columns into one XML column
XML Row Combinerread 2026-09-27Combine the XML cells of a column into a single XML value
XML to JSONread 2026-09-27Convert XML values to JSON values
XPathread 2026-09-27Run XPath queries on an XML column into new columns
XSLTread 2026-09-27Apply XSLT stylesheets to the cells of an XML column
OpenRefine (4)
Array functionsread 2026-09-2710 functions: join, sort, reverse, uniques, zip
Format-based functions (JSON, HTML, XML)read 2026-09-272 functions: jsonize, parseJson
Jsoup XML and HTML parsingread 2026-09-2712 functions: parseHtml, parseXml, select, htmlAttr, htmlText
URI parsingread 2026-09-271 function: parseUri
Pentaho Data Integration (5)
Add XMLread 2026-09-27Encode several fields into an XML fragment
Edi to XMLread 2026-09-27Convert an Edifact message to XML to ease extraction
HBase row decoderread 2026-09-27Decode an incoming HBase key and result object into fields through a mapping
XML Joinread 2026-09-27Join a stream of XML tags into a target XML string
XSL Transformationread 2026-09-27Transform an XML stream with an XSL stylesheet
Polars (12)
DataFrame.to_structread 2026-09-27Pack the columns of each row into one struct value, giving a Series
DataFrame.unnestread 2026-09-27Spread the fields of struct columns into separate columns
Expr.arr (group)read 2026-09-2729 expressions: get, contains, sort, unique, sum and others; work on the elements of fixed-size array values
Expr.list (group)read 2026-09-2744 expressions: get, contains, eval, set_union, explode and others; work on the elements of list values
Expr.str: JSON (group)read 2026-09-272 expressions: json_decode, json_path_match; parse JSON text into typed values, or pull one JSONPath match
Expr.struct (group)read 2026-09-277 expressions: field, unnest, rename_fields, with_fields, json_encode and others; read and edit struct fields
SQL functions: Array (group)read 2026-09-2712 functions: ARRAY_AGG, ARRAY_CONTAINS, ARRAY_GET, ARRAY_LENGTH, ARRAY_LOWER and others; SQL array functions
concat_arrread 2026-09-27Join several columns row by row into one fixed-size array column
concat_listread 2026-09-27Join several columns row by row into one list column
json_normalizeread 2026-09-27Flatten nested, already-decoded JSON records into a flat table
listread 2026-09-27Collect several columns into a list column, one element per expression
structread 2026-09-27Pack several columns into one struct column
Power Query M (16)
Binary functionsread 2026-09-2740 functions: BinaryFormat.Record, BinaryFormat.List, Binary.Decompress, Binary.FromText, Binary.ToText
Json.FromValueread 2026-09-27Serialise a value to JSON as binary in a given text encoding
List functionsread 2026-09-2771 functions: List.Transform, List.Select, List.Sum, List.Distinct, List.Generate
Record functionsread 2026-09-2723 functions: Record.Field, Record.ToTable, Record.FromList, Record.TransformFields, Geography.FromWellKnownText
Table.CombineColumnsToRecordread 2026-09-27Merge several columns into one record-valued column keyed by the source column names
Table.ExpandRecordColumnread 2026-09-27Spread the fields of a record-valued column into separate columns
Table.FromColumnsread 2026-09-27Build a table from a list of column value lists, with optional names or types
Table.FromListread 2026-09-27Turn a list into a table, splitting each item into columns with a splitter function
Table.FromRecordsread 2026-09-27Turn a list of records into a table, one row per record
Table.FromRowsread 2026-09-27Build a table from a list of row value lists, with optional column names or types
Table.FromValueread 2026-09-27Wrap any value or list of values as a single-column table
Table.ToColumnsread 2026-09-27Return the table as a list of lists, one inner list per column
Table.ToListread 2026-09-27Collapse each row to one value with a combiner function and return the list
Table.ToRecordsread 2026-09-27Return the table as a list of records, one per row
Table.ToRowsread 2026-09-27Return the table as a list of lists, one inner list per row
Uri functionsread 2026-09-274 functions: Uri.Parts, Uri.BuildQueryString, Uri.Combine, Uri.EscapeDataString
RapidMiner Studio (10)
Data To JSONread 2026-09-27Build nested JSON documents from the rows of a table
Decode URLsread 2026-09-27URL-decode the values of selected columns
Encode URLsread 2026-09-27URL-encode the values of selected columns
Extract Contentread 2026-09-27Extract the main text blocks from an HTML document, skipping short boilerplate
Extract Informationread 2026-09-27Extract values from a document into metadata by string match, regex, XPath or index
Generate Extractread 2026-09-27Add columns extracted from a text column by XPath, JSONPath, regex or string matching
HTML to XMLread 2026-09-27Convert an HTML document into well-formed XML
JSON To Dataread 2026-09-27Flatten JSON documents into table rows and columns
JSON to XMLread 2026-09-27Convert a JSON document to XML
Process XSLTread 2026-09-27Transform an XML document with an XSLT stylesheet
Talend (12)
tDSQL4JSONread 2026-09-27Transform JSON input into JSON output with a DSQL query
tEDIFACTtoXMLread 2026-09-27Convert an EDIFACT message file to XML by EDIFACT version and family
tExtractDynamicFieldsread 2026-09-27Parse a column of Dynamic type into standard output columns
tExtractJSONFieldsread 2026-09-27Extract values from a JSON column by JSONPath or XPath queries
tExtractXMLFieldread 2026-09-27Extract values from an XML column into the output schema
tWriteAvroFieldsread 2026-09-27Serialise rows into Avro binaries for components that need serialised input
tWriteDynamicFieldsread 2026-09-27Combine input columns into one output column of Dynamic type
tWriteJSONFieldread 2026-09-27Build a JSON field from the columns of the incoming rows
tWriteXMLFieldread 2026-09-27Build an XML structure from the input columns and write it into a field
tWriteXMLFieldsread 2026-09-27Serialise the columns of each row into one XML string or byte array column
tXMLMapread 2026-09-27Map and route XML documents between inputs and outputs, optionally joined with flat data
tXSLTread 2026-09-27Transform an XML file into an output file with an XSL stylesheet
Trifacta (8)
Convert key/value to Objectread 2026-09-27Extract key-value pairs from text into an Object column
Extract query stringsread 2026-09-27Extract fields from a URL query string
Extractkv Transformread 2026-09-27Extract key-value pairs from a string column into an Object column
Nest Transformread 2026-09-27Build an Object or Array column from the names and values of several columns
Nest columnsread 2026-09-27Convert columns into an Object or Array column
Nested Functions (group)read 2026-09-2722 functions: ARRAYCONCAT, ARRAYSTOMAP, ARRAYZIP, KEYS, LISTSUM; array and Object manipulation
Unnest Transformread 2026-09-27Unpack keys of an Object or elements of an Array into new columns
Unnest elementsread 2026-09-27Extract elements of an Object or Array into columns
VisiData (12)
addcol-selectorread 2026-09-23Add column extracting elements by a CSS selector
addcol-xmlattrread 2026-09-23Add column for a named XML attribute
contract-colread 2026-09-23Remove expanded child columns and restore the parent column
contract-col-depthread 2026-09-23Contract current column's expansion to a given depth
contract-colsread 2026-09-23Remove all expanded child columns and restore their parents
contract-cols-depthread 2026-09-23Contract all expansions to a given depth
contract-source-colsread 2026-09-23From Columns Sheet, contract selected columns into one grouped column
dive-xml-tableread 2026-09-23Open the children of current XML element as a table
expand-colread 2026-09-23Expand current column of lists or dicts into one column per key, one level
expand-col-depthread 2026-09-23Expand current column of lists or dicts to a given depth
expand-colsread 2026-09-23Expand all visible columns of lists or dicts one level
expand-cols-depthread 2026-09-23Expand all visible columns of lists or dicts to a given depth
Background
In DuckDB, JavaScript Object Notation (JSON) can be read with extraction functions or transformed all at once into the nested types LIST and STRUCT.[1] First normal form, defined by Edgar F. Codd, asks that each field hold a single value rather than a set of values or a nested table.[2] DuckDB's nested types are ARRAY, LIST, MAP, STRUCT, TUPLE, UNION and VARIANT, and each has its own rules for what a column may hold.[3]
When to use it
JSON is a lightweight, text-based, language-independent data interchange format derived from the ECMAScript Programming Language Standard.[4] In DuckDB, the JSON type is logically a VARCHAR restricted to valid JSON, and it is stored physically as a VARCHAR.[5] In DuckDB, whitespace and the order of keys are both significant when two JSON values are compared, so {"a":1,"b":2} does not equal {"b":2,"a":1}.[5] JSON itself defines an object as an unordered collection of zero or more name/value pairs.[4] Compare parsed values rather than JSON text whenever a test asks whether two documents say the same thing. (Meridian's view)
When the names within a JSON object are not unique, the behaviour of software that receives it is unpredictable: many implementations report the last pair only, and others report an error.[4] In DuckDB, duplicate keys are allowed in JSON objects.[5]
The method
DuckDB's nested types differ in what they ask of each row: a STRUCT must have the same keys in every row, a MAP may have different keys, and a LIST may have any number of elements.[3] DuckDB's unnest turns a LIST into one row per element and a STRUCT into one column per member.[6]
Compared with the alternatives
Most relational database management systems do not support table-valued columns, and normalisation to first normal form breaks nested relations up into separate relations linked by foreign keys.[2]
Sources
- [1]JSON Processing Functions – DuckDBdocumentation
- [2]First normal form - Wikipediasecondary source
- [3]Data Types – DuckDBdocumentation
- [4]RFC 8259: The JavaScript Object Notation (JSON) Data Interchange Formatstandard
- [5]JSON Type – DuckDBdocumentation
- [6]Unnesting – DuckDBdocumentation
Types it works with
FineType's registry gives 90 types a decompose expression.
Used in
5 Protocols use this operation:
- EDGAR ↔ GLEIF — Company-to-LEI Crosswalk, step
load - Movies (vega-datasets) dataset, step
load - ScienceQA dataset, step
load - SuperGPQA dataset, step
corpus - SEC EDGAR — Company Tickers, step
load