Working with JSON
JSON is a ubiquitous data interchange format that you will likely encounter in your adventures with analytical data, whether sourced from the result of API calls, extracted from other databases, or used as your target data-serialization format. As a human-readable text format with the flexibility of a self-describing schema, it is perhaps one of the most frequent sources of semi-structured data that you’re likely to encounter. DuckDB provides a range of SQL functions via its json
extension, which enables you to effectively read, transform, and write JSON data. In this section, we’ll go on a short tour of using DuckDB to work with JSON data, highlighting some key features.
The JSON extension
DuckDB’s json
extension provides a range of SQL functions for working with JSON data. It also provides the JSON
logical data type for representing and working with JSON values. Under the hood, DuckDB stores JSON values as strings; the JSON
logical type...