The Search
The Search

Reputation: 1

Pentaho Kettle Database Join Alias problem

I am using kettle version 9.4 and migrating some jobs from 5.0, i have an issue with step Database Join, in which i write a simple query that retrieves a column as alias, example: select u.user_id as user_found from user u where u.user_id = ? Then i use the alias in next step, but when i run the job i get: Fields 'user_found' used in the condition are not found in input from previous steps Even if the field is present in the Output Field and Input Field. When running job in my local environment the error is not thrown, but when i run it through kitchen.sh i get the error.

I know i can use the Select Values as workaround, but has anybody encountered the same problem before? Thanks very much for responses

Upvotes: 0

Views: 19

Answers (1)

nsousa
nsousa

Reputation: 4544

Are you by any chance running that query against MySQL? The MySQL jdbc driver doesn't return the alias, but the column name (unless it's an expression, and not a column).

In order to have it return the alias you should use the connection parameter useOldAliasMetadataBehavior=true. Other databases may have similar behaviours, it will depend a lot on their JDBC drivers' implementation.

Upvotes: 0

Related Questions