
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to convert data type boolean to tinyint(1)
Hello,
My source is cassandra DB (data type is boolean) and target is Mysql(data type is tinyint(1)).
I used below Inline condition,but i am getting only 0 value in "External" field, no single 1 value for "True" in target Mysql.
user.external.equals("true") ? 1 : 0
I have a an string in source "external" with "True/False" as value and in target i have a tinyint type with bit(1) which hold only 1 OR 0.
so i want convert "True/False" to "1/0".
Source Cassandra data type for external field is boolean
Mysql data Type for external field is tinyint(1)
Best regards,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
user.external ? 1 : 0

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi TRF,
Getting error.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is user.external daclared as a boolean field on Talend side?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi TRF,
Below is my mapping in tMap.Thanks.
Mapping In tMap Schema editor

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi TRF,
Yes, declared as a boolean field on Talend for cassandra(source) side and integer for Mysql (Target)side.Cassandra source Data type is boolean,hence i declared boolean on Talend
Mysql (Target)data type is tinyint(1),but tinyint data type is not there, hence using (int | Integer) data type
tmap data type declar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I confirm it works.
Here is a tMap with the required expression as an example:
