Mysql--Talend to sync data from MySQL to SAP HANA Database
This document would introduce the basic function of Talend. We would use this ETL tool to sync data from MySQL to SAP HANA Database.
下载地址参照:(我看了应该是有免费版)https://www.talend.com/download/
Open Talend and create a project
1. Unzip Talend Open Studio you downloaded from Talend official site to your local folder;
2. Click “TOS_DI-win32-x86.exe” to start the studio;
3. On the first run, you could choose to import the Demo Project or create a new one. This time we could create a new project for the tutorial. Input the project name “SAPBlue_Project” and click “Create” button.
4. A wizard window will pop up. Input the description and click “Finish” button.
5. Select the project you just created and click “Open” button.
6. The registration window pops up. You can just click “Skip”.
7. The studio is opened.
Create a Job
1. Let’s create a new “Job” by click the hyperlink.
2. Input the Name/Purpose/Description and click “Finish”.
3. The Studio is fully opened for the new Job.
Create DB Connections
1. Expand the “Metadata” in “Repository” window.
2. Right-click and choose “Create connection”.
MySQL
1. Input the general information.
2. Choose “MySQL” in the “DB Type” dropdown list and input the server information.
3. Click “Check” button to make sure your configuration is right and then click “Finish”.
4. Right click the connection and select “Retrieve Schema”.
5. Click “Next” and then select two tables as following.
6. Click “Finish”.
SAP HANA Database
1. If you have a look at the “DB Type”, you would find the “SAPHana” option.
2. But unfortunately, since currently we have not related component for output operation, we choose traditional “General JDBC” connection type.
* You could use the parameter “currentschema” to set the schema info.
* You need the driver “ngdbc.jar” for SAP HANA Database.
* Input “saphana_id” in the “Mapping file” textbox.
3. Now we have our connection ready.
Input Definition
1. We try to read data from MySQL. So we find the component in “Databases/MySQL”
2. Drag and Drop the component to the design area.
3. Click the “tMysqlImput_1” and see the “Component” panel below.
4. Select “Repository” for “Property Type”.
5. Choose the connection we just created for MySQL.
6. Input “orders” in “Table Name” field.
7. Create another “tMysqlInput” component for table “customers”.
Map Data
1. We use a “tMap” component to do “Join” operation. Input “tMap” in the search textbox and hit Enter.
2. Drag and drop it to the design area.
3. Right click one of the inputs and choose “Row/Main”.
4. Click “tMap_1”.
5. Do it again for another.
6. Double click the “tMap_1”.
7. Build the “Join” relation by drag and drop.
8. Click “Add” icon on the right side and add the following info.
9. Map the field by drag and drop and click “OK” button.
Output Data to HANA DB
1. Add a “tJDBCOutput” component on the design area and fill in the info as following.
2. Link the “tMap_1” with “tJDBCOuput_1” by right-click and choose “Row/out1”.
Run the Job
1. Click “run” button in the menu and the job is running.
2. Then the job finished.
3. We check the HDB and here they are.
<<over>>