Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/deltalake s3 #78

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/general.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
# key: sqlx
- name: Run non-api tests
run: |
cargo test --workspace --all-features --exclude api
cargo test --workspace --all-features --exclude api --jobs 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are jobs restricted to 1 here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


fmt:
name: Rustfmt
Expand Down Expand Up @@ -109,4 +109,4 @@ jobs:
with:
file: ./replicator/Dockerfile
push: true
tags: ${{ vars.DOCKERHUB_USERNAME }}/replicator:${{ github.head_ref || github.ref_name }}.${{ github.sha }}
tags: ${{ vars.DOCKERHUB_USERNAME }}/replicator:${{ github.head_ref || github.ref_name }}.${{ github.sha }}
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"rust-analyzer.cargo.features": ["duckdb", "bigquery", "stdout"]
"rust-analyzer.cargo.features": ["duckdb", "bigquery", "stdout", "delta"]
}
7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ actix-web = { version = "4", default-features = false }
actix-web-httpauth = { version = "0.8.2", default-features = false }
anyhow = { version = "1.0", default-features = false }
async-trait = { version = "0.1" }
aws-credential-types = { version = "1.2.0", default-features = false }
aws-config = { version = "1.5.10", default-features = false }
aws-lc-rs = { version = "1.8.1", default-features = false }
aws-sdk-sts = { version = "1.39.0", default-features = false }
aws-types = { version = "1.3.3", default-features = false }
base64 = { version = "0.22.1", default-features = false }
bigdecimal = { version = "0.4.6", default-features = false }
bytes = { version = "1.0" }
Expand All @@ -18,6 +22,8 @@ chrono = { version = "0.4", default-features = false }
clap = { version = "4.5", default-features = false }
config = { version = "0.14", default-features = false }
constant_time_eq = { version = "0.3.1" }
deltalake = { version = "0.22.0", default-features = false }
deltalake-aws = { version = "0.3.0", default-features = false }
duckdb = { version = "1.0", default-features = false, features = ["bundled"] }
futures = { version = "0.3.31", default-features = false }
# gcp-bigquery-client = { version = "0.24.1", default-features = false }
Expand Down Expand Up @@ -48,7 +54,6 @@ tracing-subscriber = { version = "0.3", default-features = false }
utoipa = { version = "4.2.3", default-features = false }
utoipa-swagger-ui = { version = "7.1.0", default-features = false }
uuid = { version = "1.10.0", default-features = false }
deltalake = {version="0.22.0",default-features = false}


# [patch."https://github.com/imor/gcp-bigquery-client"]
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ The repository is a cargo workspace. Each of the individual sub-folders are crat
- [x] Add BigQuery Sink
- [x] Add DuckDb Sink
- [x] Add MotherDuck Sink
- [x] Add Deltalake Sink (local/s3)
- [ ] Add Snowflake Sink
- [ ] Add ClickHouse Sink
- [ ] Many more to come...
Expand Down
19 changes: 17 additions & 2 deletions pg_replicate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,20 @@ required-features = ["delta"]

[dependencies]
async-trait = { workspace = true }
aws-config = { workspace = true, optional = true }
aws-credential-types = { workspace = true, optional = true }
aws-sdk-sts = { workspace = true, features = ["rustls"], optional = true }
aws-types = { workspace = true, optional = true }
bigdecimal = { workspace = true, features = ["std"] }
bytes = { workspace = true }
byteorder = { workspace = true }
chrono = { workspace = true, features = ["serde"] }
duckdb = { workspace = true, optional = true }
deltalake = { workspace = true,features=["datafusion"],optional=true }
deltalake = { workspace = true, features = [
"datafusion",
"s3",
], optional = true }
deltalake-aws = { workspace = true, optional = true }
futures = { workspace = true }
gcp-bigquery-client = { workspace = true, optional = true, features = [
"rust-tls",
Expand Down Expand Up @@ -66,7 +74,14 @@ tracing-subscriber = { workspace = true, default-features = true, features = [
bigquery = ["dep:gcp-bigquery-client", "dep:prost"]
duckdb = ["dep:duckdb"]
stdout = []
delta = ["dep:deltalake"]
delta = [
"dep:deltalake",
"dep:aws-credential-types",
"dep:aws-sdk-sts",
"dep:aws-types",
"dep:aws-config",
"dep:deltalake-aws",
]
# When enabled converts unknown types to bytes
unknown_types_to_bytes = []
default = ["unknown_types_to_bytes"]
4 changes: 3 additions & 1 deletion pg_replicate/examples/delta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ struct DbArgs {

#[derive(Debug, Args)]
struct DeltaArgs {
/// Path to the Delta Lake for saving data from the database
/// The path to the Delta Lake where data from the database will be saved.
/// Use `file:///home/data/datalake` for saving data to local file storage.
/// Use `s3://datalake` for saving data to an S3 bucket.
#[arg(long)]
delta_path: String,
}
Expand Down
Loading
Loading