Below are the list of Talend jobs which were developed as part of Global Supply Chain CO2 Emission Shipment costs detailed analysis TIERS (Core Query).

Talend Project :  DATA_OCEAN_DOMAIN_SUSTAINABILITY

GCP Project : prj-data-dm-sust-prod

Schedule : jobs are scheduled to run on 3rd of every Month.

Talend Plan in TMC: PL_GSC_CO2Emission_Shipment

BQ Details

BQ_DatasetBQ_Table

CloudStorage Bucket

STGSTG_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010

cs-ew1-prj-data-dm-sust-ppd-staging/CO2_Emission/Processed

ODSODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010

cs-ew1-prj-data-dm-sust-ppd-staging/CO2_Emission/Processed

Target File:

Final excel file is loaded in the below bucket folder for the User's to access and download it.

Bucket: cs-ew1-prj-data-dm-sust-ppd-staging/CO2_Emission/Final.

Filename: YYYYMM_TALEND_PRE_PROD_CO2_BW_QRY_MVSDTR01_0010.xlsx. For example for the month of November, Data is extracted for the previous month and loaded as in below:

Job Details

FlowNameTasksDescriptionSource_table/queryTarget_TableComplex transformation, if Yes,then logic
F1000_F_W_CO_MVSDTR01_0010<this is the Main orchestration flow which includes Data Ocean ref jobs and the new jobs>

Automated extraction of shipment details in order to calculate their CO2 emissions

Step 1: Compute the Year & Previous Month and store in a variable (in the format YYYYMM). 

Step 2: Compute meta run id using DataOcean framework job and store in a global variable

Step3: Build the BW query and pass the query to the Step 4.

Step4: Extract the data from xtract and load the csv to the cloud storage bucket.

Job: J1000_BW_Query_csv_to_GCS

Step 5: Using the Data Ocean reference jobs, process the above file in step 4 into STG & ODS tables.

ref to data ocean bucket to STG jobs: 2 - Move data from bucket to staging

STG to ODS: 3 - Move data from staging to ods

Step6: Extract the data from the ODS table for that batch execution

Job: J1100_BW_Query_ods_to_Bucket

Step 7: Using the Data Ocean reference jobs, Write the success logs into the log table.

TALEND_<ENV>_DI_BW_QRY_MVSDTR01_0010

cs-ew1-prj-data-dm-sust-<env>-staging/CO2_Emission/Final/<YYYYMM>_TALEND_PRE_PROD_CO2_BW_QRY_MVSDTR01_0010.xlsx
F1000_F_W_CO_MVSDTR01_0010J1000_BW_Query_csv_to_GCS

Use XtractUniversal tool to retrieve BW queries and upload the result to GCS

1.Extract the data from xtract and load the csv to the cloud storage bucket. Once the csv file bucket load is completed then delete the file in local Talend server.

BW: DI_BW_QRY_MVSDTR01_0010

Talend: TALEND_<env>_DI_BW_QRY_MVSDTR01_0010

cs-ew1-prj-data-dm-sust-<env>-staging/CO2_Emission
F1000_F_W_CO_MVSDTR01_0010J1100_BW_Query_ods_to_Bucket

Extract the data from the ODS table for that batch execution based on Meta_Execution_ID.

Query:

"SELECT * FROM "+ context.l_VAR_GCP_PROJECT_ID+"."+ context.l_LOCAL_VAR_STAGING_TO_ODS_DATASET_ODS + "."+context.l_LOCAL_VAR_STAGING_TO_ODS_Target_TABLE + " where meta_execution_id='" + context.Meta_Execution_ID + "'". 

The values for above context's can be found in the RDS database.

prj-data-dm-sust-<env>.ODS.ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010

cs-ew1-prj-data-dm-sust-test-staging/CO2_Emission/Final/YYYYMM_TALEND_DEV_CO2_BW_QRY_MVSDTR01_0010.xlsx



Data Mapping

ProjectIDSource TableODS Target Table NameSource ColumnRule'sFinal Target Attribute Name
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010BFC_GBU
BFC_GBU
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Source_System
Source_System
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Actual_Shipment_Completion_Y_M
Ship_Actual_Shipment_Completion_Y_M
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Actual_shipment_Completion
Ship_Actual_Shipment_Completion
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Order_number
Order_number
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Leg_indicator
Leg_indicator
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Shipment_Numberif Shipment_Number is "PF1_020/4111623978" then expected is "4111623978"
for example if Shipment_number contains"SF1_020/" then replace it with empty.
Shipment_Number
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Shipping_condit_Keyif contains "PF1_020/" then replace it with emptyShipping_conditions_core_Key
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Shipping_condit_Name
Shipping_conditions_core_Name
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Shipping_Line_Key
Ship_Shipping_Line_Key
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Shipping_Line
Ship_Shipping_Line_Name
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Forward_Agentif contains "PF1_020/" then replace it with emptyForward_Agent_Key
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Forward_Agent_Key
Forward_Agent_Name
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Shipment_Number_Shipment_Type_Core_Keyif contains "PF1_020/" then replace it with emptyShipment_Type_Core_Key
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Shipment_Number_Shipment_Type_Core_Name
Shipment_Type_Core_Name
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Shipment_Number_Shipping_Type_Keyif contains "PF1_020/" then replace it with emptyMain_Shipping_Type_Key
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Shipment_Number_Shipping_Type_Name
Main_Shipping_Type_Name
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Shipment_Number_Shipment_Vessel_name_Key
Shipment_Vessel_name_MoT_arrival_Key
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Shipment_Number_Shipment_Vessel_name_Name
Shipment_Vessel_name_MoT_arrival_Name
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Shipment_Number_Packaging_materials_Keyif contains "PF1_020/" then replace it with emptyPackaging_materials_Key
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Shipment_Number_Packaging_materials_Medium_Name
Packaging_materials_Name
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Plant_Keyif contains "PF1_020/" then replace it with emptyPlant_Key
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Plant
Plant_Name
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Departure_Point_Keyif contains "PF1_020/" then replace it with emptyShip_Departure_Point_Key
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Departure_Point
Ship_Departure_Point_Name
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Departure_Point_Postal_Code_Key
Ship_Departure_Point_Postal_Code_Key
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Departure_Point_Location_Key
Ship_Departure_Point_Location
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Departure_Point_Country_Key
Ship_Departure_Point_Country_Key
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Departure_Point_Country_Name
Ship_Departure_Point_Country_Name
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Departure_Point_Transportation_Zone_Key
Ship_Departure_Point_Transportation_Zone_Key
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Departure_Point_Transportation_Zone_Name
Ship_Departure_Point_Transportation_Zone_Name
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Departure_Point_Region_Key
Ship_Departure_Point_Region_Key
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Departure_Point_Region_Name
Ship_Departure_Point_Region_Name
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Destination_Poi_Keyif contains "PF1_020/" then replace it with emptyShip_Destination_Point_Key
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Destination_Poi
Ship_Destination_Point_Name
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Destination_Poi_Postal_Code_Key
Ship_Destination_Point_Postal_Code
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Destination_Poi_Location_Key
Ship_Destination_Point_Location
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Destination_Poi_Country_Key
Ship_Destination_Point_Country_Key
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Destination_Poi_Country_Name
Ship_Destination_Point_Country_Name
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Destination_Poi_Transportation_Zone_Key
Ship_Destination_Point_Transportation_Zone_Key
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Destination_Poi_Transportation_Zone_Name
Ship_Destination_Point_Transportation_Zone_Name
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Destination_Poi_Region_Key
Ship_Destination_Point_Region_Key
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Destination_Poi_Region_Name
Ship_Destination_Point_Region_Name
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Route_Keyif contains "PF1_020/" then replace it with emptyShip_Route_Key
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Route_Medium_Name
Ship_Route_Name
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Transportation_Key
Ship_Transportation_Mode_Key
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Transportation
Ship_Transportation_Mode_Name
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Route_Pre_Shipping_Type_Keyif contains "PF1_020/" then replace it with emptyPre_Shipping_Type_Key
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Route_Pre_Shipping_Type_Name
Pre_Shipping_Type_Name
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Route_Shipping_Type_Keyif contains "PF1_020/" then replace it with emptyShip_Route_Main_Shipping_Type_Key
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Route_Shipping_Type_Name
Ship_Route_Main_Shipping_Type_Name
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Route_Sub_Shipping_Type_Keyif contains "PF1_020/" then replace it with emptySub_Shipping_Type_Key
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Route_Sub_Shipping_Type_Name
Sub_Shipping_Type_Name
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Route_Dep_Node_Point_Keyif contains "PF1_020/" then replace it with emptyDep_Node_Point_Key
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Route_Dep_Node_Point_Medium_Name
Dep_Node_Point_Name
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Route_Dest_Node_Point_Keyif contains "PF1_020/" then replace it with emptyDest_Node_Point_Key
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Ship_Route_Dest_Node_Point_Medium_Name
Dest_Node_Point_Name
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010Gross_W_dels
Gross_W_dels
prj-data-dm-sust-<env>TALEND_PROD_DI_BW_QRY_MVSDTR01_0010ODS_BWH_0000_0000_F1000_F_W_CO_MVSDTR01_0010No_of_Deliveries
No_of_Deliveries

Data Validation/Troubleshoot queries

Data Validation:

<Provide the SQL queries to validate the data or the record count in the BQ target tables>

Logging:

<Details about the log tables in Big query>

Troubleshoot steps:

<Provide the steps to debug the ETL flow in case of failure. For example, if an ETL job fails, how should we trigger it? Can we directly rerun the job, or are there steps to delete the data from the previous execution before rerunning the job? or any change should be made in the context table for date executions>