Skip to content

Commit ec985de

Browse files
committed
[docs] Update url format
1 parent fe0a767 commit ec985de

File tree

2 files changed

+32
-31
lines changed

2 files changed

+32
-31
lines changed

README.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Please create issues if you encounter bugs and any help for the project is great
1111

1212
| Option | Required | Default | Type | Description |
1313
|:-----------------------------------------|:---------|:---------|:---------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
14-
| url | required | none | String | The ClickHouse jdbc url in format `clickhouse://<host>:<port>`. |
14+
| url | required | none | String | The ClickHouse jdbc url in format `jdbc:(ch|clickhouse)[:<protocol>]://endpoint1[,endpoint2,...][/<database>][?param1=value1&param2=value2]`. |
1515
| username | optional | none | String | The 'username' and 'password' must both be specified if any of them is specified. |
1616
| password | optional | none | String | The ClickHouse password. |
1717
| database-name | optional | default | String | The ClickHouse database name. |
@@ -54,31 +54,31 @@ Since version 1.16, we have taken shard weight into consideration, this may affe
5454

5555
## Data Type Mapping
5656

57-
| Flink Type | ClickHouse Type |
58-
|:--------------------|:--------------------------------------------------------|
59-
| CHAR | String |
60-
| VARCHAR | String / IP / UUID |
61-
| STRING | String / Enum |
62-
| BOOLEAN | UInt8 |
63-
| BYTES | FixedString |
64-
| DECIMAL | Decimal / Int128 / Int256 / UInt64 / UInt128 / UInt256 |
65-
| TINYINT | Int8 |
66-
| SMALLINT | Int16 / UInt8 |
67-
| INTEGER | Int32 / UInt16 / Interval |
68-
| BIGINT | Int64 / UInt32 |
69-
| FLOAT | Float32 |
70-
| DOUBLE | Float64 |
71-
| DATE | Date |
72-
| TIME | DateTime |
73-
| TIMESTAMP | DateTime |
74-
| TIMESTAMP_LTZ | DateTime |
75-
| INTERVAL_YEAR_MONTH | Int32 |
76-
| INTERVAL_DAY_TIME | Int64 |
77-
| ARRAY | Array |
78-
| MAP | Map |
79-
| ROW | Not supported |
80-
| MULTISET | Not supported |
81-
| RAW | Not supported |
57+
| Flink Type | ClickHouse Type |
58+
|:--------------------|:-------------------------------------------------------|
59+
| CHAR | String |
60+
| VARCHAR | String / IP / UUID |
61+
| STRING | String / Enum |
62+
| BOOLEAN | UInt8 |
63+
| BYTES | FixedString |
64+
| DECIMAL | Decimal / Int128 / Int256 / UInt64 / UInt128 / UInt256 |
65+
| TINYINT | Int8 |
66+
| SMALLINT | Int16 / UInt8 |
67+
| INTEGER | Int32 / UInt16 / Interval |
68+
| BIGINT | Int64 / UInt32 |
69+
| FLOAT | Float32 |
70+
| DOUBLE | Float64 |
71+
| DATE | Date |
72+
| TIME | DateTime |
73+
| TIMESTAMP | DateTime |
74+
| TIMESTAMP_LTZ | DateTime |
75+
| INTERVAL_YEAR_MONTH | Int32 |
76+
| INTERVAL_DAY_TIME | Int64 |
77+
| ARRAY | Array |
78+
| MAP | Map |
79+
| ROW | Not supported |
80+
| MULTISET | Not supported |
81+
| RAW | Not supported |
8282

8383
## Maven Dependency
8484

@@ -131,7 +131,7 @@ CREATE TABLE t_user (
131131
PRIMARY KEY (`user_id`) NOT ENFORCED
132132
) WITH (
133133
'connector' = 'clickhouse',
134-
'url' = 'clickhouse://{ip}:{port}',
134+
'url' = 'jdbc:ch://127.0.0.1:8123',
135135
'database-name' = 'tutorial',
136136
'table-name' = 'users',
137137
'sink.batch-size' = '500',
@@ -157,7 +157,7 @@ val tEnv = TableEnvironment.create(setting)
157157

158158
val props = new util.HashMap[String, String]()
159159
props.put(ClickHouseConfig.DATABASE_NAME, "default")
160-
props.put(ClickHouseConfig.URL, "clickhouse://127.0.0.1:8123")
160+
props.put(ClickHouseConfig.URL, "jdbc:ch://127.0.0.1:8123")
161161
props.put(ClickHouseConfig.USERNAME, "username")
162162
props.put(ClickHouseConfig.PASSWORD, "password")
163163
props.put(ClickHouseConfig.SINK_FLUSH_INTERVAL, "30s")
@@ -175,7 +175,7 @@ TableEnvironment tEnv = TableEnvironment.create(setting);
175175

176176
Map<String, String> props = new HashMap<>();
177177
props.put(ClickHouseConfig.DATABASE_NAME, "default")
178-
props.put(ClickHouseConfig.URL, "clickhouse://127.0.0.1:8123")
178+
props.put(ClickHouseConfig.URL, "jdbc:ch://127.0.0.1:8123")
179179
props.put(ClickHouseConfig.USERNAME, "username")
180180
props.put(ClickHouseConfig.PASSWORD, "password")
181181
props.put(ClickHouseConfig.SINK_FLUSH_INTERVAL, "30s");
@@ -191,7 +191,7 @@ tEnv.executeSql("insert into `clickhouse`.`default`.`t_table` select...");
191191
```sql
192192
> CREATE CATALOG clickhouse WITH (
193193
'type' = 'clickhouse',
194-
'url' = 'clickhouse://127.0.0.1:8123',
194+
'url' = 'jdbc:ch://127.0.0.1:8123',
195195
'username' = 'username',
196196
'password' = 'password',
197197
'database-name' = 'default',

flink-connector-clickhouse/src/main/java/org/apache/flink/connector/clickhouse/config/ClickHouseConfigOptions.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ public class ClickHouseConfigOptions {
4040
ConfigOptions.key(ClickHouseConfig.URL)
4141
.stringType()
4242
.noDefaultValue()
43-
.withDescription("The ClickHouse url in format `clickhouse://<host>:<port>`.");
43+
.withDescription(
44+
"The ClickHouse url in format `jdbc:(ch|clickhouse)[:<protocol>]://endpoint1[,endpoint2,...][/<database>][?param1=value1&param2=value2]`.");
4445

4546
public static final ConfigOption<String> USERNAME =
4647
ConfigOptions.key(ClickHouseConfig.USERNAME)

0 commit comments

Comments
 (0)