How to perform a CROSS JOIN with Talend?

Seven Stars

How to perform a CROSS JOIN with Talend?

I have two row links from two different tables, and need to combined them in a Cartesian way. Any idea?

Could iterate link (instead of row link) helps me, somehow?

 

Thank you,

Lorenzo

 

---

The SQL CROSS JOIN produces a result set which is the number of rows in the first table multiplied by the number of rows in the second table.

This kind of result is called as Cartesian Product.


Accepted Solutions
Fifteen Stars TRF
Fifteen Stars

Re: How to perform a CROSS JOIN with Talend?

It works as expected:

Capture.PNG

Got 3 lines in main table ("aaaaa", "bbbbb", "ccccc") and 2 lines in the lookup ("AAAAA", "BBBBB").

The result contains 6 lines:

Starting job test at 20:01 29/05/2017.

[statistics] connecting to socket on port 4063
[statistics] connected
.-----+-----.
|tLogRow_35 |
|=----+----=|
|aaa  |bbb  |
|=----+----=|
|aaaaa|AAAAA|
|aaaaa|BBBBB|
|bbbb |AAAAA|
|bbbb |BBBBB|
|ccccc|AAAAA|
|ccccc|BBBBB|
'-----+-----'

[statistics] disconnected
Job test ended at 20:01 29/05/2017. [exit code=0]

Hope this helps.

 


TRF

All Replies
Fifteen Stars TRF
Fifteen Stars

Re: How to perform a CROSS JOIN with Talend?

Never tried before, but what if you use a tMap with these 2 tables, 1 one as main and 1 as lookup, then no join in the tMap and an output flow based on fields from these tables?

TRF
Fifteen Stars TRF
Fifteen Stars

Re: How to perform a CROSS JOIN with Talend?

It works as expected:

Capture.PNG

Got 3 lines in main table ("aaaaa", "bbbbb", "ccccc") and 2 lines in the lookup ("AAAAA", "BBBBB").

The result contains 6 lines:

Starting job test at 20:01 29/05/2017.

[statistics] connecting to socket on port 4063
[statistics] connected
.-----+-----.
|tLogRow_35 |
|=----+----=|
|aaa  |bbb  |
|=----+----=|
|aaaaa|AAAAA|
|aaaaa|BBBBB|
|bbbb |AAAAA|
|bbbb |BBBBB|
|ccccc|AAAAA|
|ccccc|BBBBB|
'-----+-----'

[statistics] disconnected
Job test ended at 20:01 29/05/2017. [exit code=0]

Hope this helps.

 


TRF
Fifteen Stars TRF
Fifteen Stars

Re: How to perform a CROSS JOIN with Talend?

@Lorenzo, does this helps you?

TRF
Seven Stars

Re: How to perform a CROSS JOIN with Talend?

Yes, thanks.

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Download