Redshift extension for DuckDB: join a Redshift result with a local CSV
The script builds the workgroup and network, runs one joined statement, then deletes everything.
Your machine
AWS Cloud
VPC field-kit-redshift-duckdb-extension
3 public subnets
DuckDB 2.0.1
redshift extension v1.1.0
joins regions.csv locally
Redshift Serverless API
GetCredentials
temporary database user
Internet gateway
public endpoint
Security group
port 5439 from
this machine only
Redshift Serverless
workgroup, 4 RPU
table field_kit_orders
1
2
3
4
1
2
3
4
LINES
Redshift SQL and result rows over TLS, port 5439
IAM sign-in, no database password
FLOW
ATTACH signs in with IAM and gets temporary database credentials.
redshift_query sends Redshift SQL as written, through the built-in ODBC driver.
Redshift runs the GROUP BY and returns one row per state, not the whole table.
DuckDB joins those rows with regions.csv on the laptop, in the same statement.