[resolved] Getting rows which not gets updated.

Hi All
My CSV File contains
a1;b1;c1
a2;b2;c2
a3;b3;c3
a4;b4;c4
a5;b5;c5
My Db has
a1;NULL;c1
a2;NULL;c2
via this Job
tFileInputDelimeter----row1---->tMysqlOutput(using action Update)
I want a1 and a2 to get updated and a3,a4,a5 rows separately,in a file OR in Memory.
Can anyone help me out in this.
Thanks
1 ACCEPTED SOLUTION

Accepted Solutions
Seventeen Stars

Re: [resolved] Getting rows which not gets updated.

hi,
reload at each time is often used when you've got a lot of data in lookup and decide to filter (where clause) to get only part of these.
It's possible as The **GlobalMapKey** field is automatically created when you selected the **Reload at each row** option.
**Reload at each row**: At each row, the lookup
gets loaded again. This is mainly interesting in Jobs where the lookup volume is
large, while the main flow is pretty small. Note that this option allows you to
use dynamic variable settings such as where clause, to change/update the lookup
flow on the fly as it gets loaded, before the main flow join is processed. This
option could be considered as the counter-part of the **Store temp data** option that is available for file
lookups.

with cache :
**Reload at each row (cache)**: Expressions (in
the Lookup table) are assessed and looked up in the cache first. The results of
joins that have already been solved, are stored in the cache, in order to avoid
loading the same results twice. This option optimizes the processing time and
helps improve processing performance of the **tMap** component.

have a look at talend help tMap operation :
https://help.talend.com/search/all?query=tMap+operation&content-lang=en
you also got some great explanation & examples at component references tMap :
https://help.talend.com/search/all?query=tMap&content-lang=en
espacially :
### Scenario 6: Advanced mapping with lookup reload at each row

hope it help
regards
laurent
10 REPLIES
Four Stars

Re: [resolved] Getting rows which not gets updated.

Hi Aditya,
Whether a3,a4,a5 are present in database? When you send all records to database component, it will do its job...
If you want to filter or redirect specific rows, you need tMap component which have one of the input from database table... then you can achieve what you are looking for.
Thanks
Vaibhav

Re: [resolved] Getting rows which not gets updated.

Hi Vaibhav
Only a1 and a2 are present in Database.
a3, a4,a5 are not present in DB.
I need to update the records which are present in db, else rows i want separately.
like in above example i need a1 and a2 to get updated, else rows i need in a separate file.
i am trying to tell u the complete scenario.
i have a csv file like this
sid;type;time
S1;start;09:09:43
S2;start;09:10:43
S3;start;09:09:43
S1;stop;09:11:43
S3;stop;09:23:43
S2;stop;09:15:43
S4;stop;09:15:43
S6;stop;09:56:43
i need to put
sid, starttime and stoptime in DB like this
--------------------------------------
sid starttime stoptime
S1 09:09:43 09:11:43
S2 09:10:43 09:15:43
S3 09:09:43 09:23:43

and i need S4 and S6 session rows in a different file OR in memory.
Four Stars

Re: [resolved] Getting rows which not gets updated.

Hi Aditya,
Use tMap and lookup your input with the database... you will get all the records which are present...
Use inner join at input, select Inner join reject and you will get all the records in output which are not present in database..
Check following post for your reference
http://www.talendforge.org/forum/viewtopic.php?id=37055
Vaibhav

Re: [resolved] Getting rows which not gets updated.

Hi Vaibhav,
I tried this Inner Join in tMap,
But i can't able to use it properly.
I want both the selected as well as rejected one, so i am using two output in tmap.
can u tell me more about this like what is meant by "catch Output reject" and "catch lookup inner join reject"
Four Stars

Re: [resolved] Getting rows which not gets updated.

Hi Aditya,
InnerJoin reject is like A-B where is is your Main and B is your lookup.
Read the example for OutputReject http://www.talendforge.org/tutorials/tutorial.php?idTuto=9
Thanks
Vaibhav

Re: [resolved] Getting rows which not gets updated.

Hi Vaibhav,
Is there is concept of "Lazy Loading" OR "Lazy Lookup" in talend?
While going through this inner join and all in tMap i came across the attributes like "Lookup model" , which is "Load Once" by default.
there are other two options like
1) Reload at each row
2) Reload at each row(cache)
i tried both, but no difference in output.
I think these two option might be use in terms of "Lazy Lookup".
Can u help me in this?
Four Stars

Re: [resolved] Getting rows which not gets updated.

Can you show your tMap job design?
vaibhav
Seventeen Stars

Re: [resolved] Getting rows which not gets updated.

hi all,
could be something like @screenshoot
be aware about option in tMap.
I use an update action on table with advanced setting
hope it help
regards
laurent

Re: [resolved] Getting rows which not gets updated.

Hi Laurent,
Instead of using "Load Once" in tMap Look Model(default model).
What difference does it makes, if i use "Reload at each Row" OR "Reload at each row(cache)"?
Seventeen Stars

Re: [resolved] Getting rows which not gets updated.

hi,
reload at each time is often used when you've got a lot of data in lookup and decide to filter (where clause) to get only part of these.
It's possible as The **GlobalMapKey** field is automatically created when you selected the **Reload at each row** option.
**Reload at each row**: At each row, the lookup
gets loaded again. This is mainly interesting in Jobs where the lookup volume is
large, while the main flow is pretty small. Note that this option allows you to
use dynamic variable settings such as where clause, to change/update the lookup
flow on the fly as it gets loaded, before the main flow join is processed. This
option could be considered as the counter-part of the **Store temp data** option that is available for file
lookups.

with cache :
**Reload at each row (cache)**: Expressions (in
the Lookup table) are assessed and looked up in the cache first. The results of
joins that have already been solved, are stored in the cache, in order to avoid
loading the same results twice. This option optimizes the processing time and
helps improve processing performance of the **tMap** component.

have a look at talend help tMap operation :
https://help.talend.com/search/all?query=tMap+operation&content-lang=en
you also got some great explanation & examples at component references tMap :
https://help.talend.com/search/all?query=tMap&content-lang=en
espacially :
### Scenario 6: Advanced mapping with lookup reload at each row

hope it help
regards
laurent