Hikari
Hikari

Reputation: 3947

Pentaho Spoon: CROSS JOIN on 2 streams

I have main stream that has some fields and hundreds of thousands of records.

I created a Table Input to just query the max value of a date column. It brings 1 unique record.

Now I need to do some kind of CROSS join this Table Input into the main stream, and add this new column into ts columns set. There's no ON clause, all records will have the same value for that column.

I tried using Merge Join, but instead of adding the value to all records it added an extra record to the stream. This extra record has null on all fields and the date value on the new field, while all original records have the new field as null.

Upvotes: 1

Views: 2416

Answers (2)

xkavator
xkavator

Reputation: 386

You could use a "Join Rows (cartesian product)" step for this case.

Upvotes: 4

Dirk Trilsbeek
Dirk Trilsbeek

Reputation: 6033

you could use a stream lookup step. You would just need to make sure your main stream has a constant lookup value (add constant step right before the stream lookup) and add the same constant value in a new column to your query stream. The stream lookup should find the query result and add it to your main stream.

Upvotes: 1

Related Questions