{"id":32499389,"url":"https://github.com/clickhouse/deltalake-cdc","last_synced_at":"2025-10-27T15:53:08.711Z","repository":{"id":311496157,"uuid":"1016307082","full_name":"ClickHouse/deltalake-cdc","owner":"ClickHouse","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-17T19:24:42.000Z","size":17,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-13T03:34:36.494Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ClickHouse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-08T20:04:34.000Z","updated_at":"2025-08-28T17:03:43.000Z","dependencies_parsed_at":"2025-08-24T23:31:03.070Z","dependency_job_id":"5ae7066e-5af1-40b6-affb-e1fc1371ba5e","html_url":"https://github.com/ClickHouse/deltalake-cdc","commit_stats":null,"previous_names":["clickhouse/deltalake-cdc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ClickHouse/deltalake-cdc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClickHouse%2Fdeltalake-cdc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClickHouse%2Fdeltalake-cdc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClickHouse%2Fdeltalake-cdc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClickHouse%2Fdeltalake-cdc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ClickHouse","download_url":"https://codeload.github.com/ClickHouse/deltalake-cdc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClickHouse%2Fdeltalake-cdc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281295811,"owners_count":26476759,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-27T02:00:05.855Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-27T15:53:02.531Z","updated_at":"2025-10-27T15:53:08.697Z","avatar_url":"https://github.com/ClickHouse.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Delta Lake to ClickHouse CDC Pipeline\n\nThis project provides tools to generate sample data to a Delta Lake table and stream changes to ClickHouse using Change Data Feed (CDF).\n\n## Limitations\n\n- INSERTS / UPDATES support only (DELETEs are ignored).\n- The data generator generates a fixed schema for the Delta table.\n\n## Prerequisites\n\n- Python 3.8+\n- AWS credentials configured with access to S3\n- ClickHouse server (local or cloud)\n- Required Python packages (install with `pip install -r requirements.txt`):\n\n## 1. Generate Sample Data\n\nFirst, let's generate some sample data to a Delta Lake table in S3:\n\n```bash\npython data_generator.py -p s3://your-bucket/path/to/deltalake/table -r us-east-1\n```\n\nOptions:\n- `-p, --bucket_path`: S3 path where the Delta table will be stored (required)\n- `-r, --delta_region`: AWS region for the S3 bucket (default: us-east-1)\n- `-b, --batch-size`: Number of rows per batch (default: 10000)\n\n## 2. Query Delta Lake from ClickHouse\n\nYou can query the Delta Lake table directly from ClickHouse using the DeltaLake table engine:\n\n```sql\nCREATE TABLE my_delta_table\n    ENGINE = DeltaLake('s3://your-bucket/path/to/table')\n```\n\n## 3. Create Destination Table in ClickHouse\n\nCreate a table in ClickHouse to store the CDC changes. The schema should match your Delta table with the metadata columns:\n\n```sql\nCREATE TABLE default.my_cdc_table\n(\n    `id` String,\n    `name` String,\n    `age` Int64,\n    `created_at` DateTime,\n    `_change_type` String,\n    `_commit_version` Int64,\n    `_commit_timestamp` DateTime\n)\nENGINE = ReplacingMergeTree(`_commit_version`)\nPARTITION BY toYYYYMM(`created_at`)\nORDER BY (name, age)\nSETTINGS index_granularity = 8192;\n```\n\n## 4. Run the CDC Script\n\nRun the CDC script to stream changes from the Delta Lake table to ClickHouse:\n\n```bash\npython main.py \\\n    -p \"s3://your-bucket/path/to/table\" \\\n    -r \"us-east-2\" \\\n    -t \"default.my_cdc_table\" \\\n    -H \"host.us-west-2.aws.clickhouse.cloud\" \\\n    -u \"default\" \\\n    -P \"password\" \\\n    --access-key \"[EXAMPLE]\" \\\n    --secret-key \"[EXAMPLE]\" \\\n    -v 1\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclickhouse%2Fdeltalake-cdc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclickhouse%2Fdeltalake-cdc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclickhouse%2Fdeltalake-cdc/lists"}