Skip to main content
Question

JDBC Producer not updating the table if the table has composite primary key

  • December 26, 2022
  • 6 replies
  • 76 views

  • Discovered Fame
  • 10 replies

Hi,

I have a use case where I have multiple source tables and 1 target table. 

If any update operation I make in source tables, same should reflect in Target table.

I have a composite primary key in Target table.

When I am updating the source table, JDBC producer is not doing the Update operation in the target table.

Please guide me.

 

 

Regards,

Ankur

6 replies

Dimas Cabré i Chacón
StreamSets Employee
Forum|alt.badge.img

Hi Ankur,

We do support changes in tables with composite primary key. Only latest versions support change in primary key itself. Is this the case? Can you explain which SDC version are you using?

Best!

Dimas


  • Author
  • Discovered Fame
  • 10 replies
  • December 26, 2022

Hi @Dimas Cabré i Chacón,

I think 5.3.0 as below:

 


  • Author
  • Discovered Fame
  • 10 replies
  • December 27, 2022

Hi @Dimas Cabré i Chacón 

Does the version 5.3.0 support composite key update?


Dimas Cabré i Chacón
StreamSets Employee
Forum|alt.badge.img

Hi Ankur. Yes.


  • Author
  • Discovered Fame
  • 10 replies
  • December 27, 2022

Hi @Dimas Cabré i Chacón ,

But it is not working.

Below is the case:

There are two source tables (in actual we have six source tables):

Table1:

Columns: Col1, Col2, Col3

Primary Key: Col1

 

Table2:

Columns: Col1, Col2, Col3, Col4

Primary Key: Col1

 

There is one target table:

Target:

Columns: Tab1_col1, Tab1_col2, Tab1_col3, Tab2_col1, Tab2_col2, Tab2_col3, Tab2_col4

Primary Key: Tab1_col1, Tab2_col1

 

If I am updating Table 1 suppose Col3 

Then in Target table Tab1_col3 is not getting updated automatically.

Please look into it and suggest.

 

 


Dimas Cabré i Chacón
StreamSets Employee
Forum|alt.badge.img

Hi @Ankur . Primary key support is based on table to table mapping. Your scenario is joining tables and it is not an standard use case . We do not support this from scratch.

Best!


Reply