Skip to content
Discord Get Started

Parquet Import

Import Parquet files into DB9 tables using COPY ... FORMAT parquet from HTTP URLs. No external tools or ETL pipelines are required.

SQL
CREATE EXTENSION parquet;

Use COPY ... FORMAT parquet to import Parquet data from an HTTP URL into an existing table:

SQL
-- Import from HTTP URL
COPY my_table FROM 'https://example.com/export.parquet' FORMAT parquet;

The Parquet file schema must be compatible with the target table. Column names are matched by name (case-insensitive). Extra columns in the Parquet file are ignored.

Parquet physical types are mapped to PostgreSQL types during COPY FROM:

Parquet TypePostgreSQL Type
BOOLEANBOOLEAN
INT32INTEGER
INT64BIGINT
FLOATREAL
DOUBLEDOUBLE PRECISION
BYTE_ARRAY (UTF8)TEXT
BYTE_ARRAY (binary)BYTEA
INT96 (timestamp)TIMESTAMP
DATE logical typeDATE
TIME logical typeTIME
TIMESTAMP logical typeTIMESTAMP
DECIMAL logical typeNUMERIC
LimitValue
Max Parquet file size100 MB
Supported Parquet versionsv1, v2
Max columns per fileUnlimited (practical limit: storage)
Remote URL fetch timeout30 seconds
Supported compression codecsSnappy, Gzip, Zstd, uncompressed

See Limits and Quotas for the complete list.

ErrorCause
ERROR: unknown function: READ_PARQUETread_parquet() is not yet available. Use COPY FROM instead.
parquet: HTTP fetch failed (status 404)The remote URL returned a 404. Verify the URL is accessible.
parquet: HTTP fetch failed (timeout)Remote fetch exceeded 30 seconds.
parquet: invalid magic bytesThe file is not a valid Parquet file.
parquet: unsupported encodingFile uses an unsupported encoding. Re-export with Snappy or Gzip compression.
parquet: file too large (max 100 MB)File exceeds the 100 MB limit. Split into smaller files.
ERROR: column "x" does not existCOPY target table is missing a column present in the Parquet file.
ERROR: Only http:// and https:// URLs are supportedfs9 paths are not supported for Parquet COPY. Use an HTTP URL.