Merge pull request #26055 from kitaisreal/clickhouse-dictionary-source-secure-setting-added-documentation

ClickHouse dictionary source secure setting added documentation
This commit is contained in:
Maksim Kita 2021-07-07 23:49:42 +03:00 committed by GitHub
commit 39c5ba40f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 6 deletions

View File

@ -129,7 +129,7 @@ That dictionary source can be configured only via XML configuration. Creating di
## Executable Pool {#dicts-external_dicts_dict_sources-executable_pool}
Executable pool allows loading data from pool of processes. This source does not work with dictionary layouts that need to load all data from source. Executable pool works if the dictionary [is stored](external-dicts-dict-layout.md#ways-to-store-dictionaries-in-memory) using `cache`, `complex_key_cache`, `ssd_cache`, `complex_key_ssd_cache`, `direct`, `complex_key_direct` layouts.
Executable pool allows loading data from pool of processes. This source does not work with dictionary layouts that need to load all data from source. Executable pool works if the dictionary [is stored](external-dicts-dict-layout.md#ways-to-store-dictionaries-in-memory) using `cache`, `complex_key_cache`, `ssd_cache`, `complex_key_ssd_cache`, `direct`, `complex_key_direct` layouts.
Executable pool will spawn pool of processes with specified command and keep them running until they exit. The program should read data from STDIN while it is available and output result to STDOUT, and it can wait for next block of data on STDIN. ClickHouse will not close STDIN after processing a block of data but will pipe another chunk of data when needed. The executable script should be ready for this way of data processing — it should poll STDIN and flush data to STDOUT early.
@ -581,6 +581,7 @@ Example of settings:
<db>default</db>
<table>ids</table>
<where>id=10</where>
<secure>1</secure>
</clickhouse>
</source>
```
@ -596,6 +597,7 @@ SOURCE(CLICKHOUSE(
db 'default'
table 'ids'
where 'id=10'
secure 1
))
```
@ -609,6 +611,7 @@ Setting fields:
- `table` Name of the table.
- `where` The selection criteria. May be omitted.
- `invalidate_query` Query for checking the dictionary status. Optional parameter. Read more in the section [Updating dictionaries](../../../sql-reference/dictionaries/external-dictionaries/external-dicts-dict-lifetime.md).
- `secure` - Use ssl for connection.
### Mongodb {#dicts-external_dicts_dict_sources-mongodb}

View File

@ -224,9 +224,7 @@ void registerDictionarySourceClickHouse(DictionarySourceFactory & factory)
ClickHouseDictionarySource::Configuration configuration
{
.secure = config.getBool(settings_config_prefix + ".secure", false),
.host = host,
.port = port,
.user = config.getString(settings_config_prefix + ".user", "default"),
.password = config.getString(settings_config_prefix + ".password", ""),
.db = config.getString(settings_config_prefix + ".db", default_database),
@ -235,7 +233,9 @@ void registerDictionarySourceClickHouse(DictionarySourceFactory & factory)
.invalidate_query = config.getString(settings_config_prefix + ".invalidate_query", ""),
.update_field = config.getString(settings_config_prefix + ".update_field", ""),
.update_lag = config.getUInt64(settings_config_prefix + ".update_lag", 1),
.is_local = isLocalAddress({host, port}, default_port)
.port = port,
.is_local = isLocalAddress({host, port}, default_port),
.secure = config.getBool(settings_config_prefix + ".secure", false)
};
/// We should set user info even for the case when the dictionary is loaded in-process (without TCP communication).

View File

@ -20,9 +20,7 @@ class ClickHouseDictionarySource final : public IDictionarySource
public:
struct Configuration
{
const bool secure;
const std::string host;
const UInt16 port;
const std::string user;
const std::string password;
const std::string db;
@ -31,7 +29,9 @@ public:
const std::string invalidate_query;
const std::string update_field;
const UInt64 update_lag;
const UInt16 port;
const bool is_local;
const bool secure;
};
ClickHouseDictionarySource(