housepower / ClickHouse-Native-JDBC

ClickHouse Native Protocol JDBC implementation
https://housepower.github.io/ClickHouse-Native-JDBC/
Apache License 2.0
523 stars 145 forks source link
analytics clickhouse clickhouse-client database jdbc spark tcp-protocol

ClickHouse Native JDBC

Build Status codecov.io Maven Central Total alerts Language grade: Java License

English | 简体中文

Home Page | GitHub | Gitee

A Native JDBC library for accessing ClickHouse in Java, also provide a library for integrating with Apache Spark.

CONTRIBUTE

We welcome anyone that wants to help out in any way, whether that includes reporting problems, helping with documentations, or contributing code changes to fix bugs, add tests, or implement new features. Please follow Contributing Guide.

Supported by JetBrains Open Source License 2020-2021.

JDBC Driver

Requirements

Notes: We only do test with Java LTS versions.

Differences from yandex/clickhouse-jdbc

Limitations

Import

// normal version compile "com.github.housepower:clickhouse-native-jdbc:${clickhouse_native_jdbc_version}"


- Maven

```xml
<!-- (recommended) shaded version, available since 2.3-stable -->
<dependency>
    <groupId>com.github.housepower</groupId>
    <artifactId>clickhouse-native-jdbc-shaded</artifactId>
    <version>${clickhouse-native-jdbc.version}</version>
</dependency>

<!-- normal version -->
<dependency>
    <groupId>com.github.housepower</groupId>
    <artifactId>clickhouse-native-jdbc</artifactId>
    <version>${clickhouse-native-jdbc.version}</version>
</dependency>

Integration with Spark

Requirements

For Spark 3.2, Spark ClickHouse Connector is recommended.

Notes: Spark 2.3.x(EOL) should also work fine. Actually we do test on both Java 8 and Java 11, but Spark official support on Java 11 since 3.0.0.

Import

// available since 2.4.0
compile "com.github.housepower:clickhouse-integration-spark_2.11:${clickhouse_native_jdbc_version}"
<!-- available since 2.4.0 -->
<dependency>
    <groupId>com.github.housepower</groupId>
    <artifactId>clickhouse-integration-spark_2.11</artifactId>
    <version>${clickhouse-native-jdbc.version}</version>
</dependency>

License

This project is distributed under the terms of the Apache License (Version 2.0). See LICENSE for details.