Question

I am using kettle too make a left join between two tables who share common keys, however despite in some rare cases the join works as I intended, in most of them it returns NULL despite sharing the same key as in the cases where it works. Like in the example bellow.

EDIT: In one table I have ID_DOENTE and ID_TIPO_CONSULTA, while in other I have TIPO_CONSULTA and ID_TIPO_CONSULTA. I am merging the first table using left join with the 2nd using ID_TIPO_CONSULTA as the key. The result is the following

screenshot

As you can see the in the rows with ID_DOENTE 40, the join works in a single case, but for all the other rows despite the situation being identical it leaves the values coming from the 2nd table as NULL.


enter image description here

Was it helpful?

Solution

Regarding "merge join" step:

Note: In this step rows are expected to be sorted on the specified key fields.

(source)

OTHER TIPS

I believe that you can be using a join without adding the Sort step, otherwise unexpected results might come out.

See what the kettle documentation.

Pentaho Documentation ** PRINT show: Docs Pentaho about JOINs**

Whenever you use a JOIN in Pentaho add a Step Sort with the join IDs so that the pentaho can sort the results before joining, so you'll be able to sort without any problems.

Print - Example JOIN with SORT

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top