You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "WenDing-Y (via GitHub)" <gi...@apache.org> on 2023/07/11 12:18:40 UTC
[GitHub] [flink-connector-jdbc] WenDing-Y commented on pull request #49: [FLINK-32068] connector jdbc support clickhouse
WenDing-Y commented on PR #49:
URL: https://github.com/apache/flink-connector-jdbc/pull/49#issuecomment-1630721467
> One question that comes to my mind now.. This will only work with a 1 server no? if we have a Clickhouse cluster with more than 1 server (that will have a zookeeper envolved) will not work no?
>
> if this is true, I think we should have a note on documentation
I tried to work normally in cluster mode
My steps are as follows
1.create ck table
```
create table if not exists default.ck_flink_test_local on cluster clicks_cluster
(
user_id Int32,
message String
)
engine = ReplicatedMergeTree('/clickhouse/tables/{shard}/ck_flink_test_local', '{replica}')
PRIMARY KEY (user_id)
create table if not exists default.ck_flink_test on cluster clicks_cluster
(
user_id Int32,
message String
)
engine = Distributed('clicks_cluster', 'default', 'ck_flink_test_local', user_id);
```
2. in flink sql client
```
CREATE TABLE ck_flink_test(
user_id INTEGER,
message String
) WITH (
'connector' = 'jdbc',
'url' = 'jdbc:clickhouse://xx:xx/default',
'table-name' = 'ck_flink_test',
'username’='xx',
'password’='xx'
);
```
3. exec insert sql
```
INSERT INTO ck_flink_test (user_id, message) VALUES
(101, 'Hello');
```
4. thd data can be viewed on the ck client
```
select * from ck_flink_test;
```
5.the flink sql client

--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org