Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

REG: Json file to Postgres tables

Hi Team,

 

I have  json file generating to s3 bucket to a folder every 10 mins,  i need to take that file and dump into postgres table.

 

For Ex : 

 

0683p000009M78w.jpg

 

How can i achieve that , I have TAC as well.  The json file belong to one table - name is common 

 

here is the json file : how it look like ? 

 

[{"DateTime":"2016-09-03 14:00:00","Total_Crude_Flow_Rate_MBperDay":171.9602,"Actual_Yield_LGO_MBperDay":39.2051,"Actual_Yield_MVGO_MBperDay":22.5081,"Actual_Yield_HVGO_MBperDay":26.0575,"Actual_Yield_VGO_MBperDay":48.5655,"Actual_Yield_VR_MBperDay":22.8243,"Crude_Ambient_Temperature_DEGC":43.5956,"Desalter_Inlet_Temperature_1_DEGC":141.2322,"Desalter_Inlet_Temperature_2_DEGC":133.4597,"Resultant_Desalter_Inlet_Temperature_DEGC":138.3071,"Desalter_Outlet_Temperature_DEGC":141.5549,"Coil_Inlet_Temperature_DEGC":262.1993,"RunDate":"2019-07-26 12:51:07","SavedDate":"2019-07-26 17:49:21"}]

 

Could someone let me know how to do it and share me with screenshot ? what's the loop query i have to use and how i can get it done.

 

Thanks,

Prabuj

Labels (3)
1 Reply
Anonymous
Not applicable
Author

Hi Prabuj

 

You need to use following components:

  • tS3List
  • tExtractJSONFields
  • tDbOutput or tPostgresqlOutput (depending on your Talend Studio version)

I assume the problem is with extracting the JSON. Your loop element is "$[*]", see attached screenshot.

 

If you need more information, just let me know.

 

Kr,

Jvl7

 


Screenshot_10.png