Adds a dynamodb_scan function that enables querying DynamoDB tables.
Maintainer(s):
lukaswelsch
Installing and Loading
INSTALL dynamodb FROM community;
LOAD dynamodb;
Example
-- Create a DynamoDB secret based on the credential_chain
CREATE OR REPLACE SECRET dynamo_secret (
TYPE dynamodb
);
-- Query a DynamoDB table called 'orders'. The table has a GSI on status, to which this query restricts results.
FROM dynamodb_scan('orders')
WHERE status='ACTIVE';
-- Perform a SUM aggregation on a full table, without a GSI or PK. This requires setting allow_full_scan to true.
SELECT SUM(amount)
FROM dynamodb_scan('orders', allow_full_scan=True)
WHERE createdAt::timestamp > '2026-05-01 00:00:00'::TIMESTAMP;
About dynamodb
This extension adds support for querying DynamoDB tables directly from DuckDB. It implements filter pushdown on partition keys, sort keys, and GSIs to minimize read capacity consumption, with remaining filtering and all aggregation handled by DuckDB's execution engine. For a detailed description take a look at the extension repository.
Parameter reference:
- table_name ('orders'): Target DynamoDB table to scan.
- endpoint: Custom connection URL (useful for local development).
- allow_full_scan (false / true): Safety toggle to prevent accidental unindexed full-table reads.
- parallel_segments: Number of threads to divide and speed up the scan.
-
**schema_mode ('hybrid' 'infer')**: Controls how DynamoDB attributes are mapped to data types. - hybrid (default): activates the hybrid mode, in which rare attributes are stored in an _extra JSON column.
- infer: same as hybrid_threshold=0; all attributes are converted to columns
- hybrid_threshold (0.8): Attributes must appear in this percent of samples to be a column
- sample_size (200): How many rows should be checked to infer the schema from.
Added Functions
| function_name | function_type | description | comment | examples |
|---|---|---|---|---|
| dynamodb_scan | table | Scan a DynamoDB table directly | NULL | [FROM dynamodb_scan('orders')] |
Overloaded Functions
This extension does not add any function overloads.
Added Types
This extension does not add any types.
Added Settings
This extension does not add any settings.