|
190 | 190 | * 28 [Column Names](#column-names)
|
191 | 191 | * 28.1 [Replicate Tables With Special Column Names](#replicate-tables-with-special-column-names)
|
192 | 192 | * 28.1.1 [RQ.SRS-030.ClickHouse.MySQLToClickHouseReplication.ColumnNames.Special](#rqsrs-030clickhousemysqltoclickhousereplicationcolumnnamesspecial)
|
| 193 | + * 28.2 [Replicate Tables With Backticks in Column Names](#replicate-tables-with-backticks-in-column-names) |
| 194 | + * 28.2.1 [RQ.SRS-030.ClickHouse.MySQLToClickHouseReplication.ColumnNames.Backticks](#rqsrs-030clickhousemysqltoclickhousereplicationcolumnnamesbackticks) |
193 | 195 | * 29 [Replication Interruption](#replication-interruption)
|
194 | 196 | * 29.1 [Retry Replication When ClickHouse Instance Is Not Active](#retry-replication-when-clickhouse-instance-is-not-active)
|
195 | 197 | * 29.1.1 [RQ.SRS-030.ClickHouse.MySQLToClickHouseReplication.Interruption.ClickHouse.Instance.Stopped](#rqsrs-030clickhousemysqltoclickhousereplicationinterruptionclickhouseinstancestopped)
|
|
273 | 275 | * 34.4.1.1 [RQ.SRS-030.ClickHouse.MySQLToClickHouseReplication.MultipleDatabases.ConfigValues.IncludeList](#rqsrs-030clickhousemysqltoclickhousereplicationmultipledatabasesconfigvaluesincludelist)
|
274 | 276 | * 34.4.2 [Replicate All Databases](#replicate-all-databases)
|
275 | 277 | * 34.4.2.1 [RQ.SRS-030.ClickHouse.MySQLToClickHouseReplication.MultipleDatabases.ConfigValues.ReplicateAll](#rqsrs-030clickhousemysqltoclickhousereplicationmultipledatabasesconfigvaluesreplicateall)
|
276 |
| - * 34.5 [Table Operations](#table-operations) |
277 |
| - * 34.5.1 [Specify Database Name in Table Operations](#specify-database-name-in-table-operations) |
278 |
| - * 34.5.1.1 [RQ.SRS-030.ClickHouse.MySQLToClickHouseReplication.MultipleDatabases.TableOperations.SpecifyDatabaseName](#rqsrs-030clickhousemysqltoclickhousereplicationmultipledatabasestableoperationsspecifydatabasename) |
279 |
| - * 34.5.2 [Table Operations Without Specifying Database Name](#table-operations-without-specifying-database-name) |
280 |
| - * 34.5.2.1 [RQ.SRS-030.ClickHouse.MySQLToClickHouseReplication.MultipleDatabases.TableOperations.NoSpecifyDatabaseName](#rqsrs-030clickhousemysqltoclickhousereplicationmultipledatabasestableoperationsnospecifydatabasename) |
281 |
| - * 34.6 [Error Handling](#error-handling) |
282 |
| - * 34.6.1 [When Replicated Database Does Not Exist on the Destination](#when-replicated-database-does-not-exist-on-the-destination) |
283 |
| - * 34.6.1.1 [RQ.SRS-030.ClickHouse.MySQLToClickHouseReplication.MultipleDatabases.ErrorHandling.DatabaseNotExist](#rqsrs-030clickhousemysqltoclickhousereplicationmultipledatabaseserrorhandlingdatabasenotexist) |
284 |
| - * 34.7 [Concurrent Actions](#concurrent-actions) |
285 |
| - * 34.7.1 [Perform Table Operations on Each Database Concurrently](#perform-table-operations-on-each-database-concurrently) |
286 |
| - * 34.7.1.1 [RQ.SRS-030.ClickHouse.MySQLToClickHouseReplication.MultipleDatabases.ConcurrentActions](#rqsrs-030clickhousemysqltoclickhousereplicationmultipledatabasesconcurrentactions) |
| 278 | + * 34.5 [Overriding Source To Destination Database Name Mapping](#overriding-source-to-destination-database-name-mapping) |
| 279 | + * 34.5.1 [RQ.SRS-030.ClickHouse.MySQLToClickHouseReplication.MultipleDatabases.ConfigValues.OverrideMap](#rqsrs-030clickhousemysqltoclickhousereplicationmultipledatabasesconfigvaluesoverridemap) |
| 280 | + * 34.5.2 [Multiple Database Names](#multiple-database-names) |
| 281 | + * 34.5.2.1 [RQ.SRS-030.ClickHouse.MySQLToClickHouseReplication.MultipleDatabases.ConfigValues.OverrideMap.MultipleValues](#rqsrs-030clickhousemysqltoclickhousereplicationmultipledatabasesconfigvaluesoverridemapmultiplevalues) |
| 282 | + * 34.6 [Table Operations](#table-operations) |
| 283 | + * 34.6.1 [Specify Database Name in Table Operations](#specify-database-name-in-table-operations) |
| 284 | + * 34.6.1.1 [RQ.SRS-030.ClickHouse.MySQLToClickHouseReplication.MultipleDatabases.TableOperations.SpecifyDatabaseName](#rqsrs-030clickhousemysqltoclickhousereplicationmultipledatabasestableoperationsspecifydatabasename) |
| 285 | + * 34.6.2 [Table Operations Without Specifying Database Name](#table-operations-without-specifying-database-name) |
| 286 | + * 34.6.2.1 [RQ.SRS-030.ClickHouse.MySQLToClickHouseReplication.MultipleDatabases.TableOperations.NoSpecifyDatabaseName](#rqsrs-030clickhousemysqltoclickhousereplicationmultipledatabasestableoperationsnospecifydatabasename) |
| 287 | + * 34.7 [Error Handling](#error-handling) |
| 288 | + * 34.7.1 [When Replicated Database Does Not Exist on the Destination](#when-replicated-database-does-not-exist-on-the-destination) |
| 289 | + * 34.7.1.1 [RQ.SRS-030.ClickHouse.MySQLToClickHouseReplication.MultipleDatabases.ErrorHandling.DatabaseNotExist](#rqsrs-030clickhousemysqltoclickhousereplicationmultipledatabaseserrorhandlingdatabasenotexist) |
| 290 | + * 34.8 [Concurrent Actions](#concurrent-actions) |
| 291 | + * 34.8.1 [Perform Table Operations on Each Database Concurrently](#perform-table-operations-on-each-database-concurrently) |
| 292 | + * 34.8.1.1 [RQ.SRS-030.ClickHouse.MySQLToClickHouseReplication.MultipleDatabases.ConcurrentActions](#rqsrs-030clickhousemysqltoclickhousereplicationmultipledatabasesconcurrentactions) |
287 | 293 |
|
288 | 294 | ## Introduction
|
289 | 295 |
|
@@ -1458,6 +1464,21 @@ CREATE TABLE new_table(col1 VARCHAR(255), col2 INT, is_deleted INT)
|
1458 | 1464 |
|
1459 | 1465 | The `ReplacingMergeTree` table created on ClickHouse side SHALL be updated and the `is_deleted` column should be renamed to `_is_deleted` so there are no column name conflicts between ClickHouse and source table.
|
1460 | 1466 |
|
| 1467 | +### Replicate Tables With Backticks in Column Names |
| 1468 | + |
| 1469 | +#### RQ.SRS-030.ClickHouse.MySQLToClickHouseReplication.ColumnNames.Backticks |
| 1470 | +version: 1.0 |
| 1471 | + |
| 1472 | +[Altinity Sink Connector] SHALL support replication from the source tables that have backticks in column names. |
| 1473 | + |
| 1474 | +For example, |
| 1475 | + |
| 1476 | +If we create a source table that contains the column with the `is_deleted` name, |
| 1477 | + |
| 1478 | +```sql |
| 1479 | +CREATE TABLE new_table(col1 VARCHAR(255), `col2` INT, `is_deleted` INT) |
| 1480 | +``` |
| 1481 | + |
1461 | 1482 | ## Replication Interruption
|
1462 | 1483 |
|
1463 | 1484 | ### Retry Replication When ClickHouse Instance Is Not Active
|
@@ -1796,10 +1817,12 @@ Multiple Databases:
|
1796 | 1817 | actions:
|
1797 | 1818 | - Perform table operations on each database sequentially
|
1798 | 1819 | - Perform table operations on all databases simultaneously
|
| 1820 | + - Create database on source and map it to the database with different name on destination |
1799 | 1821 | - Remove database
|
1800 | 1822 | configValues:
|
1801 |
| - - database.include.list: database1, database2, ... , databaseN |
1802 | 1823 | - Don't specify database.include.list
|
| 1824 | + - database.include.list: database1, database2, ... , databaseN |
| 1825 | + - clickhouse.database.override.map: "test:test2, products:products2" |
1803 | 1826 | TableOperations:
|
1804 | 1827 | - types:
|
1805 | 1828 | - With database name
|
@@ -1937,6 +1960,53 @@ version: 1.0
|
1937 | 1960 |
|
1938 | 1961 | [Altinity Sink Connector] SHALL support the ability to monitor all databases from the source and replicate them to the destination without specifying the `database.include.list` configuration value.
|
1939 | 1962 |
|
| 1963 | +### Overriding Source To Destination Database Name Mapping |
| 1964 | + |
| 1965 | +#### RQ.SRS-030.ClickHouse.MySQLToClickHouseReplication.MultipleDatabases.ConfigValues.OverrideMap |
| 1966 | +version: 1.0 |
| 1967 | + |
| 1968 | +[Altinity Sink Connector] SHALL support the usage of the `clickhouse.database.override.map` configuration value to allow the user to replicate the data from the source database to the destination database with a different name. |
| 1969 | + |
| 1970 | +For example, when using the following value in configuration, |
| 1971 | + |
| 1972 | +```yaml |
| 1973 | +clickhouse.database.override.map: "mysql1:ch1" |
| 1974 | +``` |
| 1975 | + |
| 1976 | +The source database `mysql1` SHALL be mapped to the destination database `ch1`, and the data from the source `mysql1` SHALL only be replicated to the destination database `ch1`. |
| 1977 | + |
| 1978 | +```mermaid |
| 1979 | +flowchart TD |
| 1980 | + B[Read clickhouse.database.override.map] --> D[Identify Source Database mysql1] |
| 1981 | + D --> E[Map to Destination Database ch1] |
| 1982 | + E --> F[Replicate Data to ch1] |
| 1983 | +``` |
| 1984 | + |
| 1985 | +#### Multiple Database Names |
| 1986 | + |
| 1987 | +##### RQ.SRS-030.ClickHouse.MySQLToClickHouseReplication.MultipleDatabases.ConfigValues.OverrideMap.MultipleValues |
| 1988 | +version: 1.0 |
| 1989 | + |
| 1990 | +[Altinity Sink Connector] SHALL support the usage of the `clickhouse.database.override.map` configuration value to map multiple source databases to different databases on the destination. |
| 1991 | + |
| 1992 | +For example, when using the following value in configuration, |
| 1993 | + |
| 1994 | +```yaml |
| 1995 | +clickhouse.database.override.map: "mysql1:ch1, mysql2:ch2" |
| 1996 | +``` |
| 1997 | + |
| 1998 | +The source databases `mysql1` and `mysql2` SHALL be mapped to the destination databases `ch1` and `ch2`, and the data from these source databases SHALL only be replicated to the destination databases `ch1` and `ch2`. |
| 1999 | + |
| 2000 | +```mermaid |
| 2001 | +flowchart TD |
| 2002 | + B[Read clickhouse.database.override.map] |
| 2003 | + B --> C[Parse Override Map] |
| 2004 | + C --> E[Map mysql1 to ch1] |
| 2005 | + C --> F[Map mysql2 to ch2] |
| 2006 | + E --> G[Replicate Data from mysql1 to ch1] |
| 2007 | + F --> H[Replicate Data from mysql2 to ch2] |
| 2008 | +``` |
| 2009 | + |
1940 | 2010 | ### Table Operations
|
1941 | 2011 |
|
1942 | 2012 | #### Specify Database Name in Table Operations
|
|
0 commit comments