Skip to content

Commit

Permalink
[KYUUBI #6915] Fix ClickHouse integration tests
Browse files Browse the repository at this point in the history
### Why are the changes needed?

I observed ClickHouse integration test failure in GHA, after some investigation, the root cause is testcontainers/testcontainers-java#9942

```
/entrypoint.sh: neither CLICKHOUSE_USER nor CLICKHOUSE_PASSWORD is set, disabling network access for user 'default'
```

In short, the recent ClickHouse docker image does not allow the `default` user to connect without a password, unfortunately, `testcontainers-scala-clickhosue` does not expose API to set CLICKHOSUE_USER and CLICKHOUSE_PASSWORD, as a workaround, I pin `clickhouse-server:24.3.15`(the latest version has no such restriction) until a fixed version of Testcontainers available.

This PR also switches the `clickhouse-jdbc`'s classifier from `http` to `shaded`, the reason is, `http` does not ship ApacheHttpClient5, previously, it happened to work because `iceberg-runtime-spark3.5_2.12` packaged un-relocated ApacheHttpClient5 classes, but it gets fixed in Iceberg 1.8.0, then `clickhouse-jdbc:http` stop working.
```
java.lang.NoClassDefFoundError: org/apache/hc/core5/http/HttpRequest
```

Additionally, this PR bumps `clickhouse-jdbc` from 0.6.0 to 0.6.5.

### How was this patch tested?

Pass GHA.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #6915 from pan3793/fix-ch-test.

Closes #6915

996f095 [Cheng Pan] Pin clickhouse-server:24.3.15
d633df0 [Cheng Pan] Bump clickhouse-jdbc 0.6.5
214c8a2 [Cheng Pan] Fix ClickHouse integration tests

Authored-by: Cheng Pan <[email protected]>
Signed-off-by: Cheng Pan <[email protected]>
(cherry picked from commit d49c631)
Signed-off-by: Cheng Pan <[email protected]>
  • Loading branch information
pan3793 committed Feb 14, 2025
1 parent 36d625b commit 9750558
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion externals/kyuubi-jdbc-engine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
<dependency>
<groupId>com.clickhouse</groupId>
<artifactId>clickhouse-jdbc</artifactId>
<classifier>http</classifier>
<classifier>shaded</classifier>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import org.apache.kyuubi.engine.jdbc.WithJdbcServerContainer

trait WithClickHouseContainer extends WithJdbcServerContainer {

private val clickHouseDockerImage = "clickhouse/clickhouse-server:24.3"
private val clickHouseDockerImage = "clickhouse/clickhouse-server:24.3.15"

override val containerDef: ClickHouseContainer.Def = ClickHouseContainer.Def(dockerImageName =
DockerImageName.parse(clickHouseDockerImage))
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/kyuubi-jdbc-it/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
<dependency>
<groupId>com.clickhouse</groupId>
<artifactId>clickhouse-jdbc</artifactId>
<classifier>http</classifier>
<classifier>shaded</classifier>
<scope>test</scope>
</dependency>

Expand Down Expand Up @@ -188,7 +188,7 @@
<groupId>com.clickhouse</groupId>
<artifactId>clickhouse-jdbc</artifactId>
<version>${clickhouse-java.version}</version>
<classifier>http</classifier>
<classifier>shaded</classifier>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}</outputDirectory>
</artifactItem>
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
<scalatestplus.version>3.2.16.0</scalatestplus.version>
<scopt.version>4.1.0</scopt.version>
<slf4j.version>1.7.36</slf4j.version>
<clickhouse-java.version>0.6.0</clickhouse-java.version>
<clickhouse-java.version>0.6.5</clickhouse-java.version>
<snakeyaml.version>2.2</snakeyaml.version>
<!--
DO NOT forget to change the following properties when change the minor version of Spark:
Expand Down Expand Up @@ -1108,7 +1108,7 @@
<groupId>com.clickhouse</groupId>
<artifactId>clickhouse-jdbc</artifactId>
<version>${clickhouse-java.version}</version>
<classifier>http</classifier>
<classifier>shaded</classifier>
</dependency>

<!-- flink -->
Expand Down

0 comments on commit 9750558

Please sign in to comment.