In previous example we saw how to import data from input to output just a simple example.
Now In this it will explain the creation of metadata or defining the schema.
Advantage/Use: This will make metadata once defined to be more reusable , no need to define again and again same schema for same type of files.
Create a file as show in image , to define the schema.
Step1:
Step2:
Now create an input file with some details of the team. As shown in the image.
Step3:
Now as shown below , define the metadata/schema
3a) From the repository select metadata and then righjt click and select Create File Delimited.
3c). Browse to the filename to give the filepath and filename whose schema has to be defined (Team_Schema.txt) then click next and GOTO step 3d.
3d). Define the filed separator used i.e comma and select header as 1 in "Rows To Skip" Column.
and preview the file we will get the header or column name .
Click on Finish and the metadata is created.
Step4:
Now pull the components tFileInputDelimited and tFileOutputDelimited and join them using main.
Step5:
In tFileInputDelimited in Basic Settings give the file name and file path with field separator .
Then in schema select it as Repository and then click on 3 dots beside it and select the metadata which we have defined in Step 3 .
Step6: Now in tFileOutputDelimited enter the output file path and filename. and also select field separator.
Step 7:
Run the job and check the output. It will come as
Note: Try changing the schema or data type in the input file and check it will trow error as schema does not matched as we have defined in the metadata.
If you are unable to do please comment.
This Blog will help those who wants to learn from Talend from basic and that too with baby steps.
Now In this it will explain the creation of metadata or defining the schema.
Advantage/Use: This will make metadata once defined to be more reusable , no need to define again and again same schema for same type of files.
Create a file as show in image , to define the schema.
Step1:
Step2:
Now create an input file with some details of the team. As shown in the image.
Step3:
Now as shown below , define the metadata/schema
3a) From the repository select metadata and then righjt click and select Create File Delimited.
3b). Give a name for the metadata (Team_Detail_metadata) ,
3c). Browse to the filename to give the filepath and filename whose schema has to be defined (Team_Schema.txt) then click next and GOTO step 3d.
3d). Define the filed separator used i.e comma and select header as 1 in "Rows To Skip" Column.
and preview the file we will get the header or column name .
3e). Define the data types for Column Name, Team Manager are taken as String and Manager_Id is taken as Integer. As shown in the below image.
Click on Finish and the metadata is created.
Step4:
Now pull the components tFileInputDelimited and tFileOutputDelimited and join them using main.
Step5:
In tFileInputDelimited in Basic Settings give the file name and file path with field separator .
Then in schema select it as Repository and then click on 3 dots beside it and select the metadata which we have defined in Step 3 .
Step6: Now in tFileOutputDelimited enter the output file path and filename. and also select field separator.
Step 7:
Run the job and check the output. It will come as
If you are unable to do please comment.
This Blog will help those who wants to learn from Talend from basic and that too with baby steps.











No comments:
Post a Comment