Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Join 2 table with thousand columns

Hi everyone,

I'm new to Talend and I have a question:
I have table A with 1000 column, table B have a column name utcdate

I want to join 2 table on 2 key column and with condition that utcdate column in table B is in a range.

How to join it with tMap ?
Note that table A have 1000 column so that I have to use 3 tPostgresqlInput components to get data, and one other tPostgesqlInput for table B.

Labels (2)
1 Solution

Accepted Solutions
vapukov
Master II
Master II

as DBA, I always sure - 1000 columns it always wrong design

plus I absolutely agree with @rhall - this better to do inside database, with plain SQL

in this case - You do not need Talend at all 0683p000009MACn.png or just could use single component tPostgreSQLRow with SQL code

 

but if accept this situation as fact, You also could use a trick:

0683p000009Lvho.png

 

0683p000009LvqO.png

 

as You can see - we have 2 tables with 10 columns, and we want UPDATE column c20 in table 1 for all rows matched by column c9 with value from Table 2 (matched column c9, values from column c20)

 

we do not need for this define all columns in Talend, we define in tPostgreSQLInput only necessary columns:

0683p000009LvVh.png0683p000009Lvqi.png

 

than in tMap use as usual INNER JOIN

0683p000009Lvmc.png

 

same for output flow we define only key column + target column

and we use Advanced tab - use Filed option

0683p000009Lv6H.png0683p000009LvW0.png

 

result - as expected:

0683p000009Lvpb.png

 

 

in case of "Use Filed option" Talend generate SQL code similar for what You can run manually

UPDATE Table1 SET c20 = value WHERE id = value

 

 

View solution in original post

5 Replies
Anonymous
Not applicable
Author

Wow! 1000 columns! Are table A and B in the same database? If so, I would recommend joining your t{db}Input component and only bring in the data you need. 

Anonymous
Not applicable
Author

Thank you but i don't get any solution with your comment, can you explain your idea ?
Anonymous
Not applicable
Author

Sorry, my suggestion was that you write a SQL query joining the 2 tables (assuming they are both in the same database) and handle the date range logic there. The point of my suggestion was that ....

1) You do not want to be dealing with 1000 columns unless you need every single one, in your job

2) The memory overhead of dealing with that much data will lead to issues further down the line

3) Since your database is arguably going to be one of your more powerful systems (and it is meant for querying) it makes sense to filter/join your data there and send it to Talend for further processing.

 

I was kind of preempting future issues you will have with so much data AND assuming you could probably perform the join logic easier in SQL

vapukov
Master II
Master II

as DBA, I always sure - 1000 columns it always wrong design

plus I absolutely agree with @rhall - this better to do inside database, with plain SQL

in this case - You do not need Talend at all 0683p000009MACn.png or just could use single component tPostgreSQLRow with SQL code

 

but if accept this situation as fact, You also could use a trick:

0683p000009Lvho.png

 

0683p000009LvqO.png

 

as You can see - we have 2 tables with 10 columns, and we want UPDATE column c20 in table 1 for all rows matched by column c9 with value from Table 2 (matched column c9, values from column c20)

 

we do not need for this define all columns in Talend, we define in tPostgreSQLInput only necessary columns:

0683p000009LvVh.png0683p000009Lvqi.png

 

than in tMap use as usual INNER JOIN

0683p000009Lvmc.png

 

same for output flow we define only key column + target column

and we use Advanced tab - use Filed option

0683p000009Lv6H.png0683p000009LvW0.png

 

result - as expected:

0683p000009Lvpb.png

 

 

in case of "Use Filed option" Talend generate SQL code similar for what You can run manually

UPDATE Table1 SET c20 = value WHERE id = value

 

 

Anonymous
Not applicable
Author

I got it, thanks very much, both of you 0683p000009MACJ.png