kafka-connect-jdbc icon indicating copy to clipboard operation
kafka-connect-jdbc copied to clipboard

Support different timestamp/incrementing column name for multiple tables

Open abo opened this issue 9 years ago • 9 comments

abo avatar Jan 15 '16 09:01 abo

Also running into this issue. Legacy database uses different column names for timestamp columns. In one table it is LASTMODIFIED, in another its LAST_UPD. Not a deal breaker, can run multiple instances of Connect with different configurations. Would be nice to have the option to override the column names per table.

graywill avatar Feb 09 '16 18:02 graywill

Is it possible to have this feature? It's been a year since the ticket open. It is a common practice on the table schema to have different incrementing column name for different table so when you do sql join query, you don't need to rename 'id' to something else.

sunshineo avatar Jan 16 '17 20:01 sunshineo

We could really use this option. The possibility of one connector running multiple tables, with a description for each table containing timestamp and/or incrementing column name.

ekamradt avatar Apr 26 '18 18:04 ekamradt

+1 this feature could be really useful .

vishbin avatar Jun 16 '18 00:06 vishbin

+1

marioalvial avatar Jul 06 '18 14:07 marioalvial

@sunshineo , As i am new to kafka, can you explain in more detail? how to acheive syncing when single database having multiple tables having different column name.

Thanks

jpatel956 avatar Jan 10 '19 13:01 jpatel956

for instance, using the TPCH schema; if connect starts with table.whitelist="" to stream all tables with mode="incrementing" then the incrementing column for each of the 8 tables could be specified as a comma delimited list of table_name.column.name, denoting the single-column incrementing column name. For instance incrementing.column.name="PART.P_PARTKEY, REGION.R_REGIONKEY, NATION.N_NATIONKEY, SUPPLIER.S_SUPPKEY , CUSTOMER.C_CUSTKEY, ORDER.O_ORDERKEY"

The code change needed is to search this list to match the table name and use the specified column name as the incrementing.column.name. This syntax does not handle composite primary keys - for instance LINEITEM which has PRIMARY KEY (L_ORDERKEY, L_LINENUMBER) - however I believe that this is not supported by the JDBC connector anyway.

markteehan avatar Feb 06 '19 10:02 markteehan

Is this ever going to be supported?

mikeakala avatar Sep 30 '20 12:09 mikeakala

"handle composite primary keys" for numeric and non-numeric columns will be available anytime soon ?

SecretServiceNinja avatar Apr 20 '22 15:04 SecretServiceNinja