Skip to main content
Announcements
A fresh, new look for the Data Integration & Quality forums and navigation! Read more about what's changed.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

I can't download and send a simple csv file from Dropbox to Postgresql (or any DB)

I'm new to Talend and this problem seems to be extremely simple. I tried dozens of options and nothing seems to work. I would really appreciate help.

I have a file on Dropbox at the following URL:
https://www.dropbox.com/s/1lqyxvzv9p87u72/from_postgresql.csv?dl=1

 0683p000009Lypn.pngDropbox file

When you change the last parameter to "dl=1" you can download the file directly without the interface (it's a good trick, I know).

I can dowload the file using the tRest component but instead I keep passing the body of the response on the "main" rows (row5, row7,row8 with 1 row transferred) instead of the actual rows from the csv file.

The RAW Response Body from the GET call looks like (tested on Postman):
ID,Name
1,Dropbox1
2,Dropbox2
3,Dropbox3

[..]
100,Dropbox100

The two subjobs:
0683p000009LylI.pngTalend Job

The only way that I've found that works is presented on the second subjob (100 rows transfered) where I access the file saved on the first subjob by the tFileOutputRaw, but this doesn't make any sense to me. Do I need to really save the file and access on a separate subjob?

Can someone provide some guidance?

[Updates]

0683p000009LycQ.pngtRest config

 

 

Labels (4)
1 Solution

Accepted Solutions
fdenis
Master

if you want you can use tCreateTemporaryFile to use a file automatically deleted after the task.

View solution in original post

6 Replies
David_Beaty
Specialist

Can you post the Component configuration of the tRest_2 component.

 

Thanks

 

David

fdenis
Master

the tRest did not guive you the content of your file you have to open it once it is donwloaded (onSubjodOk).

 

Anonymous
Not applicable
Author

Hey @dsoulalioux, Thanks for the help.
I updated the question with the tRest component configuration.

Anonymous
Not applicable
Author

Thanks @fdenis
This is exactly what I'm doing on the second sub-job

It doesn't make sense to me to create a local file to temporarily hold the HTTP Body response, though.

I'm trying to find a way to directly send the body to the postgresql output component. However, if it's the way that works on Talend (two sub-jobs for a simple transfer), I think that my only option will be to change my mindset.

fdenis
Master

if you want you can use tCreateTemporaryFile to use a file automatically deleted after the task.

Anonymous
Not applicable
Author

Thanks @fdenis
Well, it's not the prettiest job that I've ever seen, but it works (deletes the temp file after the job execution).

 

tCreateTemporaryFile

https://help.talend.com/reader/WWQ40R_iTE5~~9VkUQrjgQ/LVyqOf5jpvzw3jzwz3wTJw

 

Use the global variables to access the temporary file and access the file on a sub-job and then send to PostgreSQL.

sdadasd0683p000009LyXA.png