Skip to content

Commit 8bf215a

Browse files
Fix integration tests (#18)
1 parent 0b390f3 commit 8bf215a

File tree

4 files changed

+31
-12
lines changed

4 files changed

+31
-12
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Install minimal nightly with clippy and rustfmt
2525
uses: dtolnay/rust-toolchain@master
2626
with:
27-
toolchain: nightly
27+
toolchain: nightly-2025-01-23
2828
components: rustfmt, clippy
2929

3030
- name: Install tool for formatting Cargo.toml files

README.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,30 @@ Load data from Parquet and Postgres to Delta Lake
1111

1212
Download the binary from the [Releases page](./releases)
1313

14-
To load data from Postgres to Delta Lake:
14+
Load data from Postgres to Delta Lake:
1515

1616
```bash
1717
export PGPASSWORD="my_password"
18-
./lakehouse-loader pg-to-delta postgres://test-user@localhost:5432/test-db -q "SELECT * FROM some_table" s3://my-bucket/path/to/table
18+
./lakehouse-loader pg-to-delta postgres://test-user@localhost:5432/test-db -q "SELECT * FROM some_table" s3://my-bucket/path/to/delta/table
1919
```
2020

21-
To load data from Parquet to Delta Lake:
21+
Load data from Parquet to Delta Lake:
2222

2323
```bash
24-
./lakehouse-loader parquet-to-delta some_file.parquet s3://my-bucket/path/to/table
24+
./lakehouse-loader parquet-to-delta some_file.parquet s3://my-bucket/path/to/delta/table
25+
```
26+
27+
Load data from Postgres to Iceberg File Catalog:
28+
29+
```bash
30+
export PGPASSWORD="my_password"
31+
./lakehouse-loader pg-to-iceberg postgres://test-user@localhost:5432/test-db -q "SELECT * FROM some_table" s3://my-bucket/path/to/iceberg/table
32+
```
33+
34+
Load data from Parquet to Iceberg File Catalog:
35+
36+
```bash
37+
./lakehouse-loader parquet-to-iceberg some_file.parquet s3://my-bucket/path/to/iceberg/table
2538
```
2639

2740
Supports standard AWS environment variables (e.g. AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_PROFILE, AWS_ENDPOINT etc).

docker-compose.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
postgres:
3-
image: postgres:16
3+
image: postgres:16.9
44
environment:
55
POSTGRES_USER: test-user
66
POSTGRES_PASSWORD: test-password
@@ -12,7 +12,7 @@ services:
1212
- ./tests/postgres-init-scripts:/docker-entrypoint-initdb.d
1313

1414
minio:
15-
image: minio/minio:latest
15+
image: quay.io/minio/minio:RELEASE.2024-11-07T00-52-20Z
1616
ports:
1717
- 9000:9000
1818
- 9001:9001
@@ -21,14 +21,20 @@ services:
2121
command: minio server /data
2222

2323
minio-setup:
24-
image: minio/mc:latest
24+
image: minio/mc:RELEASE.2025-03-12T17-29-24Z
2525
depends_on:
2626
- minio
2727
entrypoint: >
28-
/bin/sh -c "
29-
until (/usr/bin/mc config host add test-minio http://minio:9000 minioadmin minioadmin) do echo '...waiting...' && sleep 1; done;
28+
/bin/sh -c '
29+
mkdir ~/.mc;
30+
echo ''{\"version\": \"10\", \"aliases\": {\"test-minio\": {\"url\": \"http://minio:9000\", \"accessKey\": \"minioadmin\", \"secretKey\": \"minioadmin\", \"api\": \"S3v4\", \"path\": \"auto\"}}}'' > ~/.mc/config.json;
31+
cat ~/.mc/config.json;
3032
/usr/bin/mc rm -r --force test-minio/lhl-test-bucket;
3133
/usr/bin/mc mb test-minio/lhl-test-bucket;
3234
/usr/bin/mc admin user add test-minio test-user test-pass;
3335
/usr/bin/mc admin policy attach test-minio readwrite --user test-user;
34-
exit 0; "
36+
exit 0; '
37+
healthcheck:
38+
test: ["CMD", "false"] # Stack is not ready while the minio-setup container is up
39+
interval: 10s
40+
timeout: 5s

src/delta_destination.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ pub async fn record_batches_to_delta(
441441
.await?;
442442

443443
let delta_schema = deltalake::kernel::Schema::try_from(schema)?;
444-
let table_name = target_url.path_segments().unwrap().last().unwrap();
444+
let table_name = target_url.path_segments().unwrap().next_back().unwrap();
445445

446446
let table = CreateBuilder::new()
447447
.with_log_store(log_store.clone())

0 commit comments

Comments
 (0)