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

spark: Add pg jdbc driver #271

Open
wants to merge 6 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ jobs:
cd testdata/python
poetry update --quiet
- name: Test
run: cargo test --all-targets --all-features
run: RUST_BACKTRACE=1 cargo test --all-targets --all-features
4 changes: 2 additions & 2 deletions docker/spark/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM apache/spark:3.4.1 as build

# ENV https_proxy=http://192.168.110.27:7890
# ENV http_proxy=http://192.168.110.27:7890
# ENV https_proxy=http://localhost:7890
# ENV http_proxy=http://localhost:7890
# ENV use_proxy=yes

USER root
Expand Down
8 changes: 5 additions & 3 deletions docker/spark/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

set -ex

docker build -t icelake-spark .
docker tag icelake-spark:latest ghcr.io/icelake-io/icelake-spark:latest
docker build --network host -t icelake-spark .
docker tag icelake-spark ghcr.io/icelake-io/icelake-spark:0.1
docker tag icelake-spark ghcr.io/icelake-io/icelake-spark:latst
docker login ghcr.io
docker push ghcr.io/icelake-io/icelake-spark:latest
docker push ghcr.io/icelake-io/icelake-spark:0.1
docker push ghcr.io/icelake-io/icelake-spark:latest
6 changes: 6 additions & 0 deletions docker/spark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<scala.version>2.12</scala.version>
<aws.sdk.version>2.20.18</aws.sdk.version>
<hadoop.version>3.3.2</hadoop.version>
<pg.version>42.5.1</pg.version>
</properties>

<dependencies>
Expand All @@ -40,5 +41,10 @@
<artifactId>hadoop-aws</artifactId>
<version>${hadoop.version}</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${pg.version}</version>
</dependency>
</dependencies>
</project>
4 changes: 2 additions & 2 deletions docker/spark/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
<proxy>
<id>a</id>
<active>true</active>
<host>192.168.110.27</host>
<host>host.docker.internal</host>
<port>7890</port>
<protocol>http</protocol>
</proxy>
<proxy>
<id>b</id>
<active>true</active>
<host>192.168.110.27</host>
<host>host.docker.internal</host>
<port>7890</port>
<protocol>https</protocol>
</proxy>
Expand Down
8 changes: 4 additions & 4 deletions icelake/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ path = "tests/insert_compact_test.rs"
harness = false


[[test]]
name = "delta_test"
path = "tests/delta_test.rs"
harness = false
#[[test]]
#name = "delta_test"
#path = "tests/delta_test.rs"
#harness = false

[[test]]
name = "insertion_test_v2"
Expand Down
11 changes: 11 additions & 0 deletions icelake/tests/utils/poetry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ impl Poetry {
pub fn new<S: ToString>(s: S) -> Self {
let proj_dir = s.to_string();

Poetry::init(proj_dir.as_str());

Self { proj_dir }
}

Expand All @@ -29,4 +31,13 @@ impl Poetry {

run_command(cmd, desc)
}

fn init(proj_dir: &str) {
let mut cmd = Command::new(POETRY_CMD);
cmd.current_dir(proj_dir);

cmd.args(vec!["update", "--quiet"]);

run_command(cmd, "Updating poetry dependencies")
}
}
2 changes: 1 addition & 1 deletion testdata/docker/iceberg-fs/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ services:
spark:
depends_on:
- minio
image: ghcr.io/icelake-io/icelake-spark:latest
image: ghcr.io/icelake-io/icelake-spark:0.1
environment:
- SPARK_HOME=/opt/spark
- PYSPARK_PYTON=/usr/bin/python3.9
Expand Down
2 changes: 1 addition & 1 deletion testdata/docker/iceberg-rest/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ services:
depends_on:
- minio
- rest
image: ghcr.io/icelake-io/icelake-spark:latest
image: ghcr.io/icelake-io/icelake-spark:0.1
environment:
- AWS_ACCESS_KEY_ID=admin
- AWS_SECRET_ACCESS_KEY=password
Expand Down
1,031 changes: 530 additions & 501 deletions testdata/python/poetry.lock

Large diffs are not rendered by default.