Destinations
Connect Delta Lake on S3 as a destination
Connect an S3 bucket to Artie with an AWS service account. Your pipeline writes each table as a Delta table: Parquet data files with a transaction log.
Create a service account
Run this Terraform script in your AWS account. It creates an IAM user named artie-transfer, a policy for your bucket, and an access key.
provider "aws" {
region = "us-east-1" # Your AWS Region
}
resource "aws_iam_user" "artie_transfer" {
name = "artie-transfer" # Your service account name
}
resource "aws_iam_policy" "s3_read_write_policy" {
name = "s3-read-write-policy"
description = "Ability to list, read, write and delete in the bucket"
policy = jsonencode({
Version = "2012-10-17"
Statement = [
{
Effect = "Allow"
Action = [
"s3:ListBucket",
"s3:GetEncryptionConfiguration"
]
Resource = "arn:aws:s3:::your-bucket-name"
},
{
Effect = "Allow"
Action = [
"s3:GetObject",
"s3:PutObject",
"s3:DeleteObject" # Vacuum deletes files the Delta log no longer references
]
Resource = "arn:aws:s3:::your-bucket-name/*"
},
// If the bucket is encrypted with KMS:
{
Effect = "Allow",
Action = [
"kms:GenerateDataKey",
"kms:Decrypt",
],
Resource = [
"arn:aws:kms:your-region:your-account-id:key/your-kms-key-id",
]
}
]
})
}
resource "aws_iam_user_policy_attachment" "user_policy_attachment" {
user = aws_iam_user.artie_transfer.name
policy_arn = aws_iam_policy.s3_read_write_policy.arn
}
resource "aws_iam_access_key" "artie_transfer_key" {
user = aws_iam_user.artie_transfer.name
}
output "access_key_id" {
value = aws_iam_access_key.artie_transfer_key.id
sensitive = false
}
output "secret_access_key" {
value = aws_iam_access_key.artie_transfer_key.secret
sensitive = true
}Replace your-bucket-name with your bucket in both Resource lines, and set region to your AWS Region. The KMS statement applies only to a bucket encrypted with KMS: fill in your-region, your-account-id and your-kms-key-id. The access_key_id and secret_access_key outputs are the static credentials you enter in Artie.
To use Role assumption instead of an access key, create an IAM role and attach the same policy to it. Then add this trust policy to the role, so Artie can assume it.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::788826912768:user/ci"
},
"Action": "sts:AssumeRole",
"Condition": {
"StringEquals": {
"sts:ExternalId": "my-external-id"
}
}
}
]
}The Principal is Artie’s AWS identity. On a bring your own cloud (BYOC) data plane, trust the IAM identity of the data plane’s AWS credentials instead.
The Condition block is optional. Include it only when you enter an AWS external ID in Artie, and replace my-external-id with that exact value.
Connect Delta Lake in Artie
Pipeline setup has no Prepare destination step for Delta Lake, so create the service account before you start.
Choose the destination
In pipeline setup, on Choose destination, select Delta Lake (S3).
Enter the settings
On Connect and verify, fill in the required settings and any optional settings.
Verify the destination
Select Verify destination. The status reads Destination verified.
Continue
Select Continue.
Verify destination stays disabled until the pipeline has tables. To verify at a later time, select Verify later.
To change these settings on an existing pipeline, open the Destination: Delta Lake (S3) tab on the pipeline page. The fields have the same labels.
Required settings
Choose an Authentication method, then fill in the fields for that method.
| Field | Applies to | Value |
|---|---|---|
| AWS access key ID | Static credentials | The access_key_id output of the service account script. |
| AWS secret access key | Static credentials | The secret_access_key output of the service account script. |
| AWS role ARN | Role assumption | The IAM role Artie assumes, for example arn:aws:iam::123456789012:role/YourRole. |
| AWS region | Both methods | The AWS Region Artie uses to reach the bucket. Select it from the list. |
| Bucket name | Both methods | The S3 bucket Artie writes to. |
Optional settings
Every field in this table is optional.
| Field | Default | What it does |
|---|---|---|
| AWS external ID (optional) | None | The external ID Artie sends when it assumes the role. Shown with Role assumption. |
| Folder name (optional) | None | Stores every table under this folder in the bucket. |
| Table name separator | / | Joins the database, schema and table names into the table’s folder path. |
| Checkpoint interval (optional) | 10 | The number of commits between Delta checkpoints for each table. -1 turns checkpoints off. |
| Enable compaction | Off | Rewrites small Parquet files into larger ones on a schedule, then vacuums the table. |
Compaction
When Enable compaction is on, Artie rewrites each table’s small Parquet files into fewer, larger files. Compaction keeps every row and doesn’t change your data.
Artie groups files under 256 MB into sets of at least 2 files that total under 512 MB, and rewrites each set as one file. Files of 256 MB or more are left as they are. Artie checks for due tables every 60 seconds and compacts one table per check.
Two more settings appear when compaction is on:
- Compaction frequency: how often each table is compacted. The options are Hourly, Every 6 hours, Every 12 hours, Daily (recommended) and Weekly. The default is Daily.
- Quiet window (optional): set Start (UTC) and End (UTC) to run compaction only between those times. Leave both blank to allow it anytime.
A quiet window needs both times, and they must differ. A window whose start is later than its end runs past midnight, for example 22:00 to 02:00.
Vacuum
When Enable compaction is on, Artie vacuums each table after each compaction run. Vacuum deletes Parquet files that the Delta log stopped referencing more than 7 days (168 hours) ago.
Files are retained for those 7 days so readers using Delta time travel, or a query that started before a merge, can still open them. Without compaction, unreferenced files stay in the bucket.
Vacuum needs s3:DeleteObject on the bucket, which the script in Create a service account grants. Without it, replication keeps running but nothing is deleted, so unreferenced files pile up and storage grows. Add the permission to the policy to fix it.
Checkpoint interval
Artie writes a Delta checkpoint file to _delta_log after every N commits to a table, where N is the checkpoint interval. The default is 10.
A checkpoint lets readers load the table’s state without reading every commit file in the log. Each checkpoint is one more Parquet file to write. A lower interval adds write work, and a higher interval leaves readers more commit files to read. If a checkpoint write fails, the commit still succeeds and the table stays readable.
Bucket structure
Artie writes each table to its own folder in the bucket. The folder holds the table’s Parquet data files and its _delta_log transaction log:
BUCKET_NAME/FOLDER_NAME/TABLE_PATH/_delta_log/
BUCKET_NAME/FOLDER_NAME/TABLE_PATH/DATA_FILE.parquetTABLE_PATH is the database, schema and table names joined with the table name separator. With the default /, it is db/schema/tableName. DATA_FILE is a numeric timestamp, an underscore and 4 random characters. Files written by compaction start with delta_compact_ instead.
This example uses bucket artie, folder foo and table db.schema.orders:
artie/foo/db/schema/orders/_delta_log/
artie/foo/db/schema/orders/1792776403000_abc1.parquetIf you leave Folder name empty, the table folder sits at the root of the bucket. Data files are Parquet with GZIP compression.
Spark, Databricks, DuckDB and delta-rs read the table from this folder. Query the table through its Delta log, and don’t list the Parquet files directly. The folder also holds files that the log no longer references, until vacuum removes them.
Column types
Artie records these Delta types in each table’s schema.
| Source value | Delta type |
|---|---|
| Boolean | boolean |
| Integer | long |
| Float | float |
| Double | double |
| Decimal with precision from 1 to 76 | decimal(p,s) |
| Decimal with precision over 76, or no precision | string |
| Date | date |
| Timestamp with time zone | timestamp |
| Timestamp without time zone | timestamp_ntz |
| Array | array of string |
| Time, UUID, JSON object, string and every other type | string |
A table with a timestamp_ntz column declares Delta reader version 3, writer version 7 and the timestampNtz table feature. Every other table declares reader version 1 and writer version 2.
Next steps
- Write append-only Parquet files to S3 when you don’t need a Delta log.
- Review schema evolution to see how Artie handles new columns.
- Set flush rules to control how often Artie writes to the bucket.
Was this page helpful?
- Need help? Message us on Slack or email [email protected].
- Want a walkthrough? Book a demo.
- LLM? Read llms.txt.