How to define a specific pattern for a Double element in Talend MDM - 6.1

Talend Documentation Team
Talend Data Fabric
Talend MDM Platform
Data Governance > Modeling data
Talend Studio

How to define a specific pattern for a Double element in Talend MDM

This article details a way to format a Double element, it could also be used for Decimal and Float elements. In your MDM project, when you create a data model, you can define specific types to your elements such as as Double, Decimal, Float, etc.This way, each type of element, corresponds to a specific format for each column in the database. You will find more information about column formatting in Talend MDM in the article: MDM data model to RDBMS mapping.

You can define a specific pattern for Double, Decimal and Float elements in your data model.In the following example, we will apply a specific format (8,4) to a Double element.The following procedure will help you change the format:

  1. Create a new element in your entity
  2. Click-right on your element and select Change to a Simple Type
  3. Select the Custom radio button and put a name for your new type (for example "doubleType")
  4. Click-right on "doubleType" and select Change Base Type
  5. Select double in the Change Base Type window
  6. In the Properties tab, add the following pattern : [0-9]{1,8}(\.[0-9]{1,4})?

  7. Save your data model and deploy it in the MDM server
Workaround for some issues

In some specific cases of Double element,if you force the format to accept very long number, the database formatting will be shortened. It will thus appears as for example "111111E22". This issue has only been met with Double elements, not Decimal or Float.

A workaround to this issue is to change the setting "Change Base Type" to String rather than Double.