• Stars
    star
    1,316
  • Rank 32,592 (Top 0.7 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created over 7 years ago
  • Updated 26 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Java client and JDBC driver for ClickHouse

ClickHouse Java Libraries

GitHub release (latest SemVer including pre-releases) GitHub release (by tag) Coverage Sonatype Nexus (Snapshots) GitHub milestone

Java libraries for connecting to ClickHouse and processing data in various formats. Java client is async, lightweight, and low-overhead library for ClickHouse; while JDBC and R2DBC drivers are built on top of the Java client with more dependencies and features. Java 8 or higher is required to use the libraries. In addition, please use ClickHouse 20.7+ or any of active releases.

image

Features

Category Feature Supported Remark
API JDBC ✅
R2DBC ✅ supported since 0.4.0
Protocol HTTP ✅ recommended, defaults to java.net.HttpURLConnection and it can be changed to java.net.http.HttpClient(unstable) or Apache HTTP Client 5. Note that the latter was added in 0.4.0 to support custom socket options.
gRPC ✅ ⚠️ experimental, works with 22.3+, known to has issue with lz4 compression and may cause high memory usage on server
TCP/Native ✅ clickhouse-cli-client(wrapper of ClickHouse native command-line client) was added in 0.3.2-patch10, clickhouse-tcp-client will be available in 0.5
Local/File ❌ clickhouse-cli-client will be enhanced to support clickhouse-local
Compatibility Server < 20.7 ❌ use 0.3.1-patch(or 0.2.6 if you're stuck with JDK 7)
Server >= 20.7 ✅ use 0.3.2 or above. All active releases are supported.
Compression lz4 ✅ default
zstd ✅ supported since 0.4.0, works with ClickHouse 22.10+
Data Format RowBinary ✅ RowBinaryWithNamesAndTypes for query and RowBinary for insertion
TabSeparated ✅ ⚠️ does not support as many data types as RowBinary
Data Type AggregateFunction ✅ ⚠️ does not support SELECT * FROM table ...
Array(*) ✅
Bool ✅
Date* ✅
DateTime* ✅
Decimal* ✅ SET output_format_decimal_trailing_zeros=1 in 21.9+ for consistency
Enum* ✅ can be treated as both string and integer
Geo Types ✅ Point, Ring, Polygon, and MultiPolygon
Int*, UInt* ✅ UInt64 is mapped to long
IPv* ✅
Map(*) ✅
Nested(*) ✅ ⚠️ broken before 0.4.1
Object('JSON') ✅ supported since 0.3.2-patch8
SimpleAggregateFunction ✅
*String ✅ ⚠️ requires use_binary_string=true for binary string support since v0.4.0
Tuple(*) ✅
UUID ✅
High Availability Load Balancing ✅ supported since 0.3.2-patch10
Failover ✅ supported since 0.3.2-patch10
Transaction Transaction ✅ supported since 0.3.2-patch11, use ClickHouse 22.7+ for native implicit transaction support
Savepoint ❌
XAConnection ❌
Misc. Centralized Configuration ✅ supported since 0.4.2, limited to JDBC driver and requires custom server setting custom_jdbc_config for all connected JDBC clients - #1290
INFILE & OUTFILE ✅ supported since 0.4.2, limited to JDBC driver and requires localFile option - #1291
Implicit Type Conversion ✅ String/number to Date/Time/Timestamp and more
Object mapping ✅ supported since 0.4.6, slow and limited to simple data types

Usage

The library can be downloaded from both Github Releases and Maven Central. Development snapshots(aka. nightly build) are available on Sonatype OSSRH.

<repositories>
    <repository>
        <id>ossrh</id>
        <name>Sonatype OSSRH</name>
        <url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
    </repository>
</repositories>

Java Client

See examples and the docs on the ClickHouse website.

JDBC Driver

See examples and the docs on the ClickHouse website.

Contributing

Check out our contributing guide.

More Repositories

1

ClickHouse

ClickHouse® is a free analytics DBMS for big data
C++
31,818
star
2

clickhouse-go

Golang driver for ClickHouse
Go
2,584
star
3

clickhouse-presentations

Presentations, meetups and talks about ClickHouse
HTML
880
star
4

ClickBench

ClickBench: a Benchmark For Analytical Databases
HTML
468
star
5

metabase-clickhouse-driver

ClickHouse database driver for the Metabase business intelligence front-end
Clojure
416
star
6

clickhouse_exporter

This is a simple server that periodically scrapes ClickHouse stats and exports them via HTTP for Prometheus(https://prometheus.io/) consumption.
Go
322
star
7

ch-go

Low-level Go Client for ClickHouse
Go
267
star
8

clickhouse-cpp

C++ client library for ClickHouse
C++
265
star
9

graphouse

Graphouse allows you to use ClickHouse as a Graphite storage.
Java
257
star
10

NoiSQL

NoiSQL — Generating Music With SQL Queries
SQL
238
star
11

clickhouse-odbc

ODBC driver for ClickHouse
C++
233
star
12

dbt-clickhouse

The Clickhouse plugin for dbt (data build tool)
Python
176
star
13

clickhouse-connect

Python driver/sqlalchemy/superset connectors
Python
161
star
14

clickhouse-jdbc-bridge

A JDBC proxy from ClickHouse to external databases
Java
151
star
15

clickhouse-js

Official JS client for ClickHouse DB
TypeScript
125
star
16

github-explorer

Everything You Always Wanted To Know About GitHub (But Were Afraid To Ask)
HTML
122
star
17

clickhouse-kafka-connect

ClickHouse Kafka Connector
Java
104
star
18

clickhouse-docs

Official documentation for ClickHouse
JavaScript
67
star
19

homebrew-clickhouse

ClickHouse Homebrew tap (old repository, unused)
57
star
20

clickhouse-tableau-connector-jdbc

Tableau connector to ClickHouse using JDBC driver
JavaScript
50
star
21

pastila

Paste toy-service on top of ClickHouse
HTML
40
star
22

power-bi-clickhouse

This connector allows you to retrieve data from ClickHouse directly into Power BI for analysis and visualization
29
star
23

click-ui

The home of the ClickHouse design system and component library.
TypeScript
29
star
24

ch-bench

Benchmarks for ch
Go
26
star
25

examples

ClickHouse Examples
Jinja
24
star
26

libhdfs3

HDFS file read access for ClickHouse
C++
23
star
27

HouseClick

House prices app
JavaScript
17
star
28

sysroot

Files for cross-compilation
C
15
star
29

clickhub

Github analytics powered by the world's fastest real-time analytics database
Python
12
star
30

web-tables-demo

11
star
31

clickpy

PyPI analytics powered by ClickHouse
JavaScript
8
star
32

terraform-provider-clickhouse

Terraform Provider for ClickHouse Cloud
Go
8
star
33

icudata

Pregenerated data for ICU library
Assembly
7
star
34

clickhouse-website-worker

TypeScript
6
star
35

checkout

Wrapper around actions/checkout for flexible tuning
5
star
36

laion

Supporting code for inserting and searching laion in ClickHouse
Python
5
star
37

aretestsgreenyet

A single-page website to display the status of the open-source ClickHouse CI system.
HTML
4
star
38

fuzz-corpus

Corpuses for libFuzzer-type fuzzers
4
star
39

clickhouse-playground-old

4
star
40

protobuf

add protobuf for libhdfs3
C++
2
star
41

clickhouse-com-content

HTML
2
star
42

boost

Minimized boost lib
C++
2
star
43

clickhouse.github.io

HTML
2
star
44

ssl

Minimized libressl
C
2
star
45

libpq

Copy of https://github.com/postgres/postgres/tree/master/src/interfaces/libpq with some files from root
C
2
star
46

clickhouse-website-content

JavaScript
2
star
47

llvm

Stripped version of LLVM for use in ClickHouse for runtime code generation.
C++
2
star
48

kafka-samples

Sample datasets for Kafka
Python
2
star
49

clickhouse-test.github.io

HTML
1
star
50

hive-metastore

For files generated with https://github.com/apache/thrift
Thrift
1
star
51

antlr4-runtime

Subtree of antlr4 original repo
C++
1
star
52

doc-pr-preview-test

Testing workflow to build Docusaurus previews for pull requests.
JavaScript
1
star
53

UnixODBC

Mirror of http://www.unixodbc.org/
C
1
star
54

clickhouse-docs-content

1
star
55

clickhouse-blog-images

HTML
1
star
56

clickhouse_vs_snowflake

HTML
1
star
57

grpc

Stripped version of grpc
C++
1
star
58

bzip2

Forked from https://gitlab.com/federicomenaquintero/bzip2
C
1
star
59

libgsasl

https://www.gnu.org/software/gsasl/
C
1
star
60

readthedocs-stub

HTML
1
star
61

clickhouse-repos-manager

a config and artifacts for packages.clickhouse.com
Python
1
star