Talend is one of the fast-growing Data Integration solution to enable deep analytics and data integration requirements. In this lab, we will use Talend Open Studio to work with MySQL
You must have JDK 1.8 installed, download and install from https://www.oracle.com/java/technologies/javase-jdk8-downloads.html Simply create a batch file to specify the JDK 1.8 VM, for example, talend.bat
TOS_DI-win-x86_64.exe -vm "C:\Program Files\Java\jdk1.8.0_241\bin"
Download and install Telend Open Studio on Windows from https://www.talend.com/products/talend-open-studio/. Talend Open Studio (TOS) is an Eclipse-based tools.
Once you have installed TOS, run TOS
You will be prompted to install additional features/plugins. Go ahead to install the Required third-party libraries. Optionally, you can install the Optional third-party libraries (It will take quite a bit of time to install both the third-party libraries)
If you are running Talend on Windows platform, some of the display panels don't display properly and you can't resize the panels. You can run "Troubleshoot Compatibility" on the Talend program to have Windows fix the display issue.
Create a JSON data set by creating a new Metadata object, File Json
-
Specify the fields to be extracted. First, select account_number and drag it to the Path Loop Expression panel. Next select all the remaining fields, and drag them to the Fields to extract panel. Click on Refresh Preview
Create a DB Connection object to MySQL
Now it is time to use the 2 objects we created earlier to build a data processing pipeline
- Select accounts (File Json object), mysql (DB Connections object), drop them to the Job Designer panel
- Select tLogRow and tMap objects in the Palette on the right panel, drop them to the Job Designer panel
- Wire up connections from accounts to mysql, we will just try to process 1 row 4 Finally, test the pipeline job! You should be able to see 1 row inserted to the accounts table in MySQL
mysql> create table accounts (balance int, firstname varchar(20), lastname varchar(20), age int, gender char(1), address varchar(30), employer varchar(20), email varchar(20), city varchar(6), state char(2), id smallint auto_increment primary key);
Query OK, 0 rows affected (0.32 sec)
mysql> select * from accounts;
+---------+-----------+----------+------+--------+-----------------+----------+----------------------+--------+-------+----+
| balance | firstname | lastname | age | gender | address | employer | email | city | state | id |
+---------+-----------+----------+------+--------+-----------------+----------+----------------------+--------+-------+----+
| 39225 | Amber | Duke | 32 | M | 880 Holmes Lane | Pyrami | [email protected] | Brogan | IL | 1 |
+---------+-----------+----------+------+--------+-----------------+----------+----------------------+--------+-------+----+
1 row in set (0.00 sec)
Voila!