parquet_s3_fdw
Foreign data wrapper for accessing Parquet files on local filesystems and Amazon S3 from PostgreSQL.
parquet_s3_fdw · Foreign data wrapper for accessing Parquet files on local filesystems and Amazon S3 from PostgreSQL.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 101038 | parquet_s3_fdw | parquet_s3_fdw | 0.3 | FDW | PostgreSQL | C++ |
PostgreSQL · 13, 14, 15, 16, 17
Usage
Sources:
parquet_s3_fdw maps Parquet files on the PostgreSQL server, Amazon S3, or a MinIO-compatible endpoint as foreign tables. It supports typed and schemaless scans, row-group pruning, parallel/multifile readers, import helpers, and file-rewriting INSERT, UPDATE, and DELETE operations.
Core Workflow
Create a server, store S3 credentials in a user mapping, and point a foreign table at one or more files:
For MinIO, set server option use_minio and configure the documented endpoint. Local paths are resolved on the database server under the PostgreSQL operating-system account.
Important Options and Features
filenameselects a space-separated file list;dirnameselects a directory. A single foreign table cannot mix local and S3 paths.sorted,files_in_order,max_open_files,use_mmap, anduse_threadsselect ordered, cached, memory-mapped, or parallel decoding strategies.files_funcdynamically returns file paths;insert_file_selectorchooses the target file for new rows. Treat both functions as privileged routing logic.schemaless = 'true'represents each row in onejsonbcolumn. Typed mode maps documented Arrow primitives plus arrays and maps; structs and nested lists are unsupported.IMPORT FOREIGN SCHEMA,import_parquet_s3, andimport_parquet_s3_explicitcan derive foreign tables from files.
Modification and Transaction Boundaries
- Upstream explicitly states that transactions are not supported. A PostgreSQL rollback cannot be assumed to undo a Parquet/S3 modification; never combine these writes with transactional business updates expecting atomicity.
- Updates and deletes rebuild cached data and overwrite the old Parquet file. Large files are slow, and concurrent modification of the same file can produce inconsistent results.
- Marked
keycolumns identify rows for update/delete but the FDW does not enforce their uniqueness. Validate uniqueness externally and avoid concurrent writers. WITH CHECK OPTION,ON CONFLICT, andRETURNINGare not supported. Compression is limited tozstd,snappy, or uncompressed output with the documented restrictions.- Credentials stored in user mappings are catalog secrets; restrict server and mapping visibility, use narrow object-store policies and TLS, rotate keys, and audit endpoint/region settings.
- Pin the required Arrow/Parquet and AWS SDK versions and compiler ABI. Test schema evolution, time zones, nulls, numeric precision, map/list conversion, network failure, partial overwrite, connection caching, and restore procedures before production use.