For the complete documentation index, see llms.txt. This page is also available as Markdown.
Iceberg
Connect & Ingest data from / to Apache Iceberg tables
Apache Iceberg is an open table format for huge analytic datasets. Iceberg adds tables to compute engines including Spark, Trino, PrestoDB, Flink, Hive and Impala using a high-performance table format that works just like a SQL table. See https://iceberg.apache.org/ for more details.
Sling supports connecting to Iceberg tables through catalog backends including REST catalogs, AWS Glue, and SQL catalogs.
Setup
The following credentials keys are accepted:
Common Properties
catalog_type(required) -> The catalog type: rest, glue, or sql. Default is rest.
schema (optional) -> The default schema to use to read/write data. Default is main.
REST Catalog Configuration
rest_uri(required for REST) -> The REST catalog endpoint URI (e.g., https://s3tables.us-east-1.amazonaws.com/iceberg, https://catalog.cloudflarestorage.com/xxxxxxxxx/warehouse, http://localhost:8181).
rest_warehouse (optional) -> Warehouse location for the catalog (e.g., s3://bucket/warehouse, arn:aws:s3tables:region:account-id:bucket/namespace).
rest_token (optional) -> OAuth token for authentication.
rest_oauth_client_id (optional) -> OAuth client ID for authentication.
rest_oauth_client_secret (optional) -> OAuth client secret for authentication.
rest_oauth_scope (optional) -> OAuth scope for authentication.
rest_oauth_server_uri (optional) -> OAuth server URI for token requests.
rest_prefix (optional) -> API prefix for the REST catalog.
# List namespaces (schemas)
sling conns discover ICEBERG
# List tables in a namespace
sling conns discover ICEBERG --schema my_namespace
# Query data
sling run --src-conn ICEBERG --src-stream "SELECT * FROM my_namespace.orders LIMIT 10" --stdout
# Export to CSV
sling run --src-conn ICEBERG --src-stream my_namespace.orders --tgt-object file://./orders.csv
# Import CSV to Iceberg
sling run --src-stream file://./data.csv --tgt-conn ICEBERG --tgt-object my_namespace.new_data
# Import from PostgreSQL
sling run --src-conn POSTGRES_DB --src-stream public.customers --tgt-conn ICEBERG --tgt-object sales.customers
# Export to Parquet files
sling run --src-conn ICEBERG --src-stream sales.orders --tgt-conn AWS_S3 --tgt-object s3://bucket/exports/orders.parquet
# Incremental sync with timestamp
sling run --src-conn POSTGRES_DB --src-stream public.events --tgt-conn ICEBERG --tgt-object events.raw --mode incremental --primary-key id --update-key updated_at
# For complex SQL queries, Sling uses DuckDB with Iceberg extension
# Tables must be qualified with "iceberg_catalog" prefix
# Note: Custom SQL queries via DuckDB are only supported with REST and Glue catalog types
sling run --src-conn ICEBERG --src-stream "SELECT count(*) FROM iceberg_catalog.my_namespace.my_table" --stdout
# Join multiple Iceberg tables
sling run --src-conn ICEBERG --src-stream "
SELECT o.*, c.customer_name
FROM iceberg_catalog.sales.orders o
JOIN iceberg_catalog.sales.customers c ON o.customer_id = c.id
" --stdout
# Export with custom SQL
sling run --src-conn ICEBERG --src-stream "
SELECT date_trunc('month', order_date) as month, sum(amount) as total
FROM iceberg_catalog.sales.orders
GROUP BY 1 ORDER BY 1
" --tgt-object file://./monthly_sales.csv