设置示例:
SOURCE(CLICKHOUSE(
host 'example01-01-1'
port 9000
user 'default'
password ''
db 'default'
table 'ids'
where 'id=10'
secure 1
query 'SELECT id, value_1, value_2 FROM default.ids'
));
<source>
<clickhouse>
<host>example01-01-1</host>
<port>9000</port>
<user>default</user>
<password></password>
<db>default</db>
<table>ids</table>
<where>id=10</where>
<secure>1</secure>
<query>SELECT id, value_1, value_2 FROM default.ids</query>
</clickhouse>
</source>
设置字段:
| 设置 | 说明 |
|---|
host | ClickHouse 主机。如果是本地主机,则查询会在没有任何网络通信的情况下处理。为提高容错能力,你可以创建一个 Distributed 表,并在后续配置中填入该表。 |
port | ClickHouse server 的端口。 |
user | ClickHouse 用户名。 |
password | ClickHouse 用户的密码。 |
db | 数据库名称。 |
table | 表名。 |
where | 筛选条件。可选。 |
invalidate_query | 用于检查字典状态的查询。可选。更多信息,请参见使用 LIFETIME 刷新字典数据一节。 |
secure | 连接时使用 SSL。 |
query | 自定义查询。可选。 |
table 或 where 字段不能与 query 字段同时使用。此外,必须声明 table 或 query 字段之一。