/
githubmirror
/
ydb-importer
Обзор
Документация
Войти
/
githubmirror
/
ydb-importer
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
scripts/sample-clickhouse.xml
70 строк
3 KB
Pavel Chichev
Add ClickHouse support
22 май 2026, 20:13
22 май 2026, 20:13
e088d01
Код
Авторство
О чём код?
<?xml version="1.0" encoding="UTF-8"?> <!-- ClickHouse to YDB importer job configuration example --> <ydb-importer> <workers> <reader-pool size="4"/> </workers> <source type="clickhouse"> <jdbc-class>com.clickhouse.jdbc.ClickHouseDriver</jdbc-class> <jdbc-url>jdbc:clickhouse://hostname:8123/default</jdbc-url> <username>default</username> <password>password</password> <!-- ClickHouse has no JDBC cursor, so this sets rows per partition read chunk (recommended 200000 or higher) --> <fetch-size>200000</fetch-size> </source> <target type="ydb"> <script-file>sample-clickhouse.yql.tmp</script-file> <connection-string>grpcs://ydb.serverless.yandexcloud.net:2135?database=/ru-central1/b1gfvslmokutuvt2g019/etn63999hrinbapmef6g</connection-string> <!-- <connection-string>grpcs://hostname.demo.com:2135?database=/local</connection-string> --> <!-- Custom TLS certificate file, if needed <tls-certificate-file>ca.crt</tls-certificate-file> --> <!-- ENV, NONE, STATIC, METADATA, SAKEY --> <auth-mode>ENV</auth-mode> <!-- auth-mode: STATIC <static-login>username</static-login> <static-password>password</static-password> --> <!-- auth-mode: SAKEY <sa-key-file>ydb-sa-keyfile.json</sa-key-file> --> <replace-existing>true</replace-existing> <load-data>true</load-data> <max-batch-rows>1000</max-batch-rows> <max-blob-rows>200</max-blob-rows> </target> <table-options name="default"> <!-- ASIS, LOWER, UPPER --> <case-mode>ASIS</case-mode> <!-- Substitution values: ${schema}, ${table} --> <table-name-format>chimp1/${schema}/${table}</table-name-format> <!-- Substitution values: ${schema}, ${table}, ${field} --> <blob-name-format>chimp1/${schema}/${table}_${field}</blob-name-format> <!-- DATE_NEW, DATE, INT, STR --> <conv-date>DATE_NEW</conv-date> <conv-timestamp>DATE_NEW</conv-timestamp> <allow-custom-decimal>true</allow-custom-decimal> <skip-unknown-types>true</skip-unknown-types> </table-options> <table-map options="default"> <include-schemas regexp="true">.*</include-schemas> <!-- Possible extra tags: include-tables, exclude-tables, exclude-schemas --> </table-map> <table-ref options="default"> <schema-name>system</schema-name> <table-name>tables</table-name> <key-column>database</key-column> <key-column>name</key-column> </table-ref> <table-ref options="default"> <schema-name>system</schema-name> <table-name>columns</table-name> <query-text>SELECT database, table, name, type FROM system.columns</query-text> <key-column>database</key-column> <key-column>table</key-column> <key-column>name</key-column> </table-ref> </ydb-importer>