Create
The Airport extension supports the creation of tables. The Arrow Flight server can decide if the table should actually be created.
Example
For a DuckDB session to create a table, a standard SQL CREATE TABLE
statement is executed in a schema that is managed by the Airport extension.
-- Attach an Airport database
'example' (TYPE AIRPORT, location 'grpc://localhost:50312/');
ATTACH
-- assume that there is a `main` schema
-- already in the `example` database
CREATE TABLE example.main.employees (
varchar,
name id integer
);
-- You can also CREATE TABLE AS
CREATE TABLE more_employees AS (
SELECT * from source_table
);
Apache Arrow Extension Types
DuckDB supports several custom data types—such as uuid
, tinyint
, hugeint
, uhugeint
, time_tz
, json
, bit
, and varint
—using Apache Arrow’s extension type mechanism. These extension types preserve rich type information when exchanging data with other users of Apache Arrow.
To include extension type metadata when exporting data to Arrow, enable lossless conversion by setting the arrow_lossless_conversion
configuration option:
SET arrow_lossless_conversion = true;
This ensures that DuckDB emits the appropriate Arrow extension types, allowing Arrow Flight servers to interpret the data with full type fidelity.
Arrow Flight Server Implementation Notes
The Airport extension will perform a DoAction
Arrow Flight RPC with a method name of create_table
.