Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOCAPI-6207: EN review and RU translation for the JDBC table engine #5413

Merged
merged 8 commits into from Jun 6, 2019
13 changes: 7 additions & 6 deletions docs/en/operations/table_engines/jdbc.md
Expand Up @@ -2,14 +2,15 @@

Allows ClickHouse to connect to external databases via [JDBC](https://en.wikipedia.org/wiki/Java_Database_Connectivity).

To implement JDBC connection, ClickHouse uses the third-party program [clickhouse-jdbc-bridge](https://github.com/alex-krash/clickhouse-jdbc-bridge). Installation instructions are in it's documentation. You should run it as a daemon.
To implement the JDBC connection, ClickHouse uses the separate program [clickhouse-jdbc-bridge](https://github.com/alex-krash/clickhouse-jdbc-bridge) that should run as a daemon.

This engine supports the [Nullable](../../data_types/nullable.md) data type.

## Creating a Table

```
CREATE TABLE [IF NOT EXISTS] [db.]table_name ENGINE = JDBC(dbms_uri, external_database, external_table)
```sql
CREATE TABLE [IF NOT EXISTS] [db.]table_name
ENGINE = JDBC(dbms_uri, external_database, external_table)
```

**Engine Parameters**
Expand All @@ -20,11 +21,11 @@ CREATE TABLE [IF NOT EXISTS] [db.]table_name ENGINE = JDBC(dbms_uri, external_d
Example for MySQL: `jdbc:mysql://localhost:3306/?user=root&password=root`.

- `external_database` — Database in an external DBMS.
- `external_table` — A name of the table in `external_database`.
- `external_table` — Name of the table in `external_database`.

## Usage Example

Creating a table in MySQL (using native MySQL engine):
Creating a table in MySQL server by connecting directly with it's console client:

```
mysql> CREATE TABLE `test`.`test` (
Expand All @@ -47,7 +48,7 @@ mysql> select * from test;
1 row in set (0,00 sec)
```

Selecting data from the table in ClickHouse:
Creating a table in ClickHouse server and selecting data from it:

```
CREATE TABLE jdbc_table ENGINE JDBC('jdbc:mysql://localhost:3306/?user=root&password=root', 'test', 'test')
Expand Down
37 changes: 19 additions & 18 deletions docs/ru/operations/table_engines/jdbc.md
@@ -1,30 +1,31 @@
# JDBC

Allows ClickHouse to connect to external databases via [JDBC](https://en.wikipedia.org/wiki/Java_Database_Connectivity).
Позволяет ClickHouse подключаться к внешним базам данных с помощью [JDBC](https://en.wikipedia.org/wiki/Java_Database_Connectivity).

To implement JDBC connection, ClickHouse uses the separate program [clickhouse-jdbc-bridge](https://github.com/alex-krash/clickhouse-jdbc-bridge). You should run it as a daemon.
Для реализации соединения по JDBC ClickHouse использует отдельную программу [clickhouse-jdbc-bridge](https://github.com/alex-krash/clickhouse-jdbc-bridge), которая должна запускаться как демон.

This engine supports the [Nullable](../../data_types/nullable.md) data type.
Движок поддерживает тип данных [Nullable](../../data_types/nullable.md).

## Creating a Table
## Создание таблицы

```
CREATE TABLE [IF NOT EXISTS] [db.]table_name ENGINE = JDBC(dbms_uri, external_database, external_table)
```sql
CREATE TABLE [IF NOT EXISTS] [db.]table_name
ENGINE = JDBC(dbms_uri, external_database, external_table)
```

**Engine Parameters**
**Параметры движка**

- `dbms_uri` — URI of an external DBMS.
- `dbms_uri` — URI внешней СУБД.

Format: `jdbc:<driver_name>://<host_name>:<port>/?user=<username>&password=<password>`.
Example for MySQL: `jdbc:mysql://localhost:3306/?user=root&password=root`.
Формат: `jdbc:<driver_name>://<host_name>:<port>/?user=<username>&password=<password>`.
Пример для MySQL: `jdbc:mysql://localhost:3306/?user=root&password=root`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут точно всё нормально с отступами?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Отступ ок, а вот пробела после формата не хватало.


- `external_database` — Database in an external DBMS.
- `external_table` — A name of the table in `external_database`.
- `external_database` — база данных во внешней СУБД.
- `external_table` — таблица в `external_database`.

## Usage Example
## Пример использования

Creating a table in MySQL (using native MySQL engine):
Создадим таблицу в на сервере MySQL с помощью консольного клиента MySQL:

```
mysql> CREATE TABLE `test`.`test` (
Expand All @@ -47,7 +48,7 @@ mysql> select * from test;
1 row in set (0,00 sec)
```

Selecting data from the table in ClickHouse:
Создадим таблицу на сервере ClickHouse и получим из неё данные:

```
CREATE TABLE jdbc_table ENGINE JDBC('jdbc:mysql://localhost:3306/?user=root&password=root', 'test', 'test')
Expand Down Expand Up @@ -75,8 +76,8 @@ FROM jdbc_table
1 rows in set. Elapsed: 0.055 sec.
```

## See Also
## Смотрите также

- [JDBC table function](../../query_language/table_functions/jdbc.md).
- [Табличная функция JDBC](../../query_language/table_functions/jdbc.md).

[Original article](https://clickhouse.yandex/docs/en/operations/table_engines/jdbc/) <!--hide-->
[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/table_engines/jdbc/) <!--hide-->
2 changes: 1 addition & 1 deletion docs/toc_fa.yml
Expand Up @@ -97,7 +97,7 @@ nav:
- 'Buffer': 'operations/table_engines/buffer.md'
- 'JDBC': 'operations/table_engines/jdbc.md'
- 'ODBC': 'operations/table_engines/odbc.md'

- 'SQL Reference':
- 'hidden': 'query_language/index.md'
- 'SELECT': 'query_language/select.md'
Expand Down
2 changes: 1 addition & 1 deletion docs/toc_ru.yml
Expand Up @@ -98,7 +98,7 @@ nav:
- 'Buffer': 'operations/table_engines/buffer.md'
- 'JDBC': 'operations/table_engines/jdbc.md'
- 'ODBC': 'operations/table_engines/odbc.md'

- 'Справка по SQL':
- 'hidden': 'query_language/index.md'
- 'SELECT': 'query_language/select.md'
Expand Down