Search Shortcut cmd + k | ctrl + k

Read AWS Ion data and write Ion text or binary with typed mappings

Compatibility Matrix

This table covers all DuckDB releases that have not reached end-of-life, including LTS releases, and shows the 2 most recent patch releases of each. Older patch releases are not listed, but the extension may be available for them as well.

Platform 1.5.5 1.5.6 2.0.0 2.0.1
Linux AMD64
Linux ARM64
macOS AMD64
macOS ARM64
Windows AMD64
Windows ARM64
WebAssembly

Installing and Loading

INSTALL ion FROM community;
LOAD ion;

Example

-- Read Ion files (text or binary)
SELECT * FROM read_ion('sample.ion');

-- Control schema and parsing options
SELECT * FROM read_ion('sample.ion', columns := {id: 'BIGINT', label: 'VARCHAR'});
SELECT * FROM read_ion('scalars.ion', records := false);
SELECT * FROM read_ion('array.ion', format := 'array');

-- Write Ion text or binary
CREATE TABLE ion_demo AS SELECT 1::INTEGER AS id, 'hello' AS label;
COPY ion_demo TO 'out.ion' (FORMAT ION);
COPY ion_demo TO 'out.ion' (FORMAT ION, BINARY TRUE);

About ion

The ion extension enables DuckDB to read AWS Ion in text and binary formats and write Ion text or binary, preserving Ion types where possible for richer analytics.

Added Functions

function_name function_type description comment examples
read_ion table Read Ion text or binary files into DuckDB rows, inferring column types unless a schema is provided. NULL [SELECT * FROM read_ion('test/ion/sample.ion')]
to_ion scalar Serialize a DuckDB value as Ion text and return it as VARCHAR; nested lists and structs are supported. NULL [to_ion(struct_pack(a := 1, b := ['x', 'y']))]

Overloaded Functions

This extension does not add any function overloads.

Added Types

This extension does not add any types.

Added Settings

name description input_type scope aliases typed_value
temp_directory Set the directory to which temporary files are written. VARCHAR GLOBAL [] post.db.tmp
© 2026 DuckDB Foundation, Amsterdam NL
DuckDB Home Code of Conduct Trademark Use Blog