Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
0.3.1
* BREAKING CHANGE - move query from url to request body
* BREAKING CHANGE - always parse SQL(use extended API to skip that)
* BREAKING CHANGE - remove keepAliveTimeout and useNewParser from ClickHouseProperties
* BREAKING CHANGE - exclude RoaringBitmap from shaded jar
* add new connection setting useSharedCookieStore for load balancing
* add new query parameters: allow_experimental_bigint_types, allow_experimental_map_type, and join_algorithm
* add new format: CustomSeparated and RowBinaryWithNamesAndTypes
* fix 400 bad request error when dealing with large query
* fix parser issue when DESC statement contains alias
* support batch processing with arbitrary query - update and delete are not recommended so there'll be warnings
* support multi-statement sql - session will be used automatically and only the last result will be returned
0.3.0
* BREAKING CHANGE - dropped JDK 7 support
* BREAKING CHANGE - removed Guava dependency(and so is UnsignedLong)
Expand Down
42 changes: 23 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,32 @@ URL syntax:
JDBC Driver Class:
`ru.yandex.clickhouse.ClickHouseDriver`

additionally, if you have a few instances, you can use `BalancedClickhouseDataSource`.

**Notice**

To use an up-to-date version of RoaringBitmap, please update your POM with below two changes:
```xml
<!-- 1. add repository -->
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
For example:
```java
String url = "jdbc:clickhouse://localhost:8123/test";
ClickHouseProperties properties = new ClickHouseProperties();
// set connection options - see more defined in ClickHouseConnectionSettings
properties.setClientName("Agent #1");
...
// set default request options - more in ClickHouseQueryParam
properties.setSessionId("default-session-id");
...

<!-- 2. add dependency(groupId is different from the one in maven central) -->
<dependency>
<groupId>com.github.RoaringBitmap</groupId>
<artifactId>RoaringBitmap</artifactId>
<version>0.9.10</version>
</dependency>
ClickHouseDataSource dataSource = new ClickHouseDataSource(url, properties)
String sql = "select * from mytable";
Map<ClickHouseQueryParam, String> additionalDBParams = new HashMap<>();
// set request options, which will override the default ones in ClickHouseProperties
additionalDBParams.put(ClickHouseQueryParam.SESSION_ID, "new-session-id");
...
try (ClickHouseConnection conn = dataSource.getConnection();
ClickHouseStatement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(sql, additionalDBParams)) {
...
}
```

Additionally, if you have a few instances, you can use `BalancedClickhouseDataSource`.

### Extended API
In order to provide non-JDBC complaint data manipulation functionality, proprietary API exists.
Entry point for API is `ClickHouseStatement#write()` method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* @author Dmitry Andreev <a href="mailto:[email protected]"></a>
*/
public enum ClickHouseFormat {

CustomSeparated,
TabSeparated,
TabSeparatedRaw,
TabSeparatedWithNames,
Expand Down
12 changes: 1 addition & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<lz4.version>1.7.1</lz4.version>
<jackson-core.version>2.9.10</jackson-core.version>
<jackson-databind.version>2.9.10.8</jackson-databind.version>
<roaring-bitmap.version>0.9.3</roaring-bitmap.version>
<roaring-bitmap.version>0.9.10</roaring-bitmap.version>
<slf4j.version>1.7.30</slf4j.version>
<mockito.version>1.10.19</mockito.version>
<wiremock.version>2.27.2</wiremock.version>
Expand Down Expand Up @@ -432,14 +432,4 @@
</build>
</profile>
</profiles>

<!--
Add below to get latest RoaringBitmap lib
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
-->
</project>