Skip to content

Commit 3105b24

Browse files
committed
fix
1 parent 1781ab7 commit 3105b24

File tree

4 files changed

+0
-166
lines changed

4 files changed

+0
-166
lines changed

CONTRIBUTING.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ In the case you don't want to use docker and/or prefer to test against an existi
8585
- add below two configuration files to the existing server and expose all defaults ports for external access
8686
- [ports.xml](../../blob/main/clickhouse-client/src/test/resources/containers/clickhouse-server/config.d/ports.xml) - enable all ports
8787
- and [users.xml](../../blob/main/clickhouse-client/src/test/resources/containers/clickhouse-server/users.d/users.xml) - accounts used for integration test
88-
Note: you may need to change root element from `clickhouse` to `yandex` when testing old version of ClickHouse.
8988
- make sure ClickHouse binary(usually `/usr/bin/clickhouse`) is available in PATH, as it's required to test `clickhouse-cli-client`
9089
- put `test.properties` under either `~/.clickhouse` or `src/test/resources` of your project, with content like below:
9190
```properties

clickhouse-client/src/test/resources/containers/clickhouse-server/patch

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,8 @@
33
set -e
44

55
SERVER_CONF_DIR="/etc/clickhouse-server"
6-
ROOT_ELEMENT="yandex"
7-
REPLACE_TO="clickhouse"
8-
9-
if [ -n "$(grep 'yandex>' /entrypoint.sh >/dev/null)" ]; then
10-
ROOT_ELEMENT="clickhouse"
11-
REPLACE_TO="yandex"
12-
fi
136

147
\cp -rfv "$(dirname $0)/." $SERVER_CONF_DIR
15-
find $SERVER_CONF_DIR -type f -name "*.xml" -exec sed -i -e "s|$ROOT_ELEMENT>|$REPLACE_TO>|g" {} \; || true
168

179
if chown clickhouse:clickhouse -R /etc/clickhouse-server/certs; then
1810
echo "Ownership of /etc/clickhouse-server/certs changed successfully."

clickhouse-jdbc/README.md

Lines changed: 0 additions & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -5,158 +5,4 @@ See the [ClickHouse website](https://clickhouse.com/docs/en/integrations/languag
55

66
## Examples
77
For more example please check [here](https://github.com/ClickHouse/clickhouse-java/tree/main/examples/jdbc).
8-
## Upgrade path
9-
### to 0.3.2+
108

11-
Please refer to cheatsheet below to upgrade JDBC driver to 0.3.2+.
12-
13-
<table>
14-
<thead>
15-
<tr>
16-
<th>#</th>
17-
<th>Item</th>
18-
<th>&lt;= 0.3.1-patch</th>
19-
<th>&gt;= 0.3.2</th>
20-
</tr>
21-
</thead>
22-
<tbody>
23-
<tr>
24-
<td>1</td>
25-
<td>pom.xml</td>
26-
<td><pre><code class="language-xml">&lt;dependency&gt;
27-
&lt;groupId&gt;ru.yandex.clickhouse&lt;/groupId&gt;
28-
&lt;artifactId&gt;clickhouse-jdbc&lt;/artifactId&gt;
29-
&lt;version&gt;0.3.1-patch&lt;/version&gt;
30-
&lt;classifier&gt;shaded&lt;/classifier&gt;
31-
&lt;exclusions&gt;
32-
&lt;exclusion&gt;
33-
&lt;groupId&gt;*&lt;/groupId&gt;
34-
&lt;artifactId&gt;*&lt;/artifactId&gt;
35-
&lt;/exclusion&gt;
36-
&lt;/exclusions&gt;
37-
&lt;/dependency&gt;
38-
</code></pre></td>
39-
<td><pre><code class="language-xml">&lt;dependency&gt;
40-
&lt;groupId&gt;com.clickhouse&lt;/groupId&gt;
41-
&lt;artifactId&gt;clickhouse-jdbc&lt;/artifactId&gt;
42-
&lt;version&gt;0.3.2-patch11&lt;/version&gt;
43-
&lt;classifier&gt;all&lt;/classifier&gt;
44-
&lt;exclusions&gt;
45-
&lt;exclusion&gt;
46-
&lt;groupId&gt;*&lt;/groupId&gt;
47-
&lt;artifactId&gt;*&lt;/artifactId&gt;
48-
&lt;/exclusion&gt;
49-
&lt;/exclusions&gt;
50-
&lt;/dependency&gt;
51-
</code></pre></td>
52-
</tr>
53-
<tr>
54-
<td>2</td>
55-
<td>driver class</td>
56-
<td>ru.yandex.clickhouse.ClickHouseDriver</td>
57-
<td>com.clickhouse.jdbc.ClickHouseDriver</td>
58-
</tr>
59-
<tr>
60-
<td>3</td>
61-
<td>connection string</td>
62-
<td><pre><code class="language-text">jdbc:clickhouse://[user[:password]@]host:port[/database][?parameters]</code></pre></td>
63-
<td><pre><code class="language-text">jdbc:(ch|clickhouse)[:protocol]://endpoint[,endpoint][/database][?parameters][#tags]</code></pre>
64-
<b>endpoint:</b> [protocol://]host[:port][/database][?parameters][#tags]<br/>
65-
<b>protocol:</b> (grpc|grpcs|http|https|tcp|tcps)<br/>
66-
</td>
67-
</tr>
68-
<tr>
69-
<td>4</td>
70-
<td>custom settings</td>
71-
<td><pre><code class="language-java">String jdbcUrl = "jdbc:clickhouse://localhost:8123/default?socket_timeout=6000000"
72-
// custom server settings
73-
+ "&max_bytes_before_external_group_by=16000000000"
74-
+ "&optimize_aggregation_in_order=0"
75-
+ "&join_default_strictness=ANY"
76-
+ "&join_algorithm=auto"
77-
+ "&max_memory_usage=20000000000"; </code></pre></td>
78-
<td><pre><code class="language-java">String jdbcUrl = "jdbc:clickhouse://localhost/default?socket_timeout=6000000"
79-
// or properties.setProperty("custom_settings", "a=1,b=2,c=3")
80-
+ "&custom_settings="
81-
// url encoded settings separated by comma
82-
+ "max_bytes_before_external_group_by%3D16000000000%2C"
83-
+ "optimize_aggregation_in_order%3D0%2C"
84-
+ "join_default_strictness%3DANY%2C"
85-
+ "join_algorithm%3Dauto%2C"
86-
+ "max_memory_usage%3D20000000000"; </code></pre></td>
87-
</tr>
88-
<tr>
89-
<td>5</td>
90-
<td>load balancing</td>
91-
<td><pre><code class="language-java">String connString = "jdbc:clickhouse://server1:8123,server2:8123,server3:8123/database";
92-
BalancedClickhouseDataSource balancedDs = new BalancedClickhouseDataSource(
93-
connString).scheduleActualization(5000, TimeUnit.MILLISECONDS);
94-
ClickHouseConnection conn = balancedDs.getConnection("default", "");
95-
</code></pre></td>
96-
<td><pre><code class="language-java">String connString = "jdbc:ch://server1,server2,server3/database"
97-
+ "?load_balancing_policy=random&health_check_interval=5000&failover=2";
98-
ClickHouseDataSource ds = new ClickHouseDataSource(connString);
99-
ClickHouseConnection conn = ds.getConnection("default", "");
100-
</code></pre></td>
101-
</tr>
102-
<tr>
103-
<td>6</td>
104-
<td>DateTime</td>
105-
<td><pre><code class="language-java">try (PreparedStatement ps = conn.preparedStatement("insert into mytable(start_datetime, string_value) values(?,?)") {
106-
ps.setObject(1, LocalDateTime.now());
107-
ps.setString(2, "value");
108-
ps.executeUpdate();
109-
}
110-
</code></pre></td>
111-
<td><pre><code class="language-java">try (PreparedStatement ps = conn.preparedStatement("insert into mytable(start_datetime, string_value) values(?,?)") {
112-
// resolution of DateTime32 or DateTime without scale is 1 second
113-
ps.setObject(1, LocalDateTime.now().truncatedTo(ChronoUnit.SECONDS));
114-
ps.setString(2, "value");
115-
ps.executeUpdate();
116-
}
117-
</code></pre></td>
118-
</tr>
119-
<tr>
120-
<td>7</td>
121-
<td>extended API</td>
122-
<td><pre><code class="language-java">ClickHouseStatement sth = connection.createStatement();
123-
sth.write().send("INSERT INTO test.writer", new ClickHouseStreamCallback() {
124-
@Override
125-
public void writeTo(ClickHouseRowBinaryStream stream) throws IOException {
126-
for (int i = 0; i < 10; i++) {
127-
stream.writeInt32(i);
128-
stream.writeString("Name " + i);
129-
}
130-
}
131-
}, ClickHouseFormat.RowBinary); // RowBinary or Native are supported
132-
</code></pre></td>
133-
<td><pre><code class="language-java">// 0.3.2
134-
Statement sth = connection.createStatement();
135-
sth.unwrap(ClickHouseRequest.class).write().table("test.writer")
136-
.format(ClickHouseFormat.RowBinary).data(out -> {
137-
for (int i = 0; i < 10; i++) {
138-
// write data into the piped stream in current thread
139-
BinaryStreamUtils.writeInt32(out, i);
140-
BinaryStreamUtils.writeString(out, "Name " + i);
141-
}
142-
}).sendAndWait();
143-
144-
// since 0.4
145-
PreparedStatement ps = connection.preparedStatement("insert into test.writer format RowBinary");
146-
ps.setObject(new ClickHouseWriter() {
147-
@Override
148-
public void write(ClickHouseOutputStream out) throws IOException {
149-
for (int i = 0; i < 10; i++) {
150-
// write data into the piped stream in current thread
151-
BinaryStreamUtils.writeInt32(out, i);
152-
BinaryStreamUtils.writeString(out, "Name " + i);
153-
}
154-
}
155-
});
156-
// ClickHouseWriter will be executed in a separate thread
157-
ps.executeUpdate();
158-
</code></pre></td>
159-
160-
</tr>
161-
</tbody>
162-
</table>

examples/r2dbc/misc/docker/clickhouse-docker-mount/config.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,9 +1036,6 @@
10361036
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
10371037
</session_log>
10381038

1039-
<!-- Parameters for embedded dictionaries, used in Yandex.Metrica.
1040-
See https://clickhouse.com/docs/en/dicts/internal_dicts/
1041-
-->
10421039

10431040
<!-- Path to file with region hierarchy. -->
10441041
<!-- <path_to_regions_hierarchy_file>/opt/geo/regions_hierarchy.txt</path_to_regions_hierarchy_file> -->

0 commit comments

Comments
 (0)