Featured Post

Applying Email Validation to a JavaFX TextField Using Binding

This example uses the same controller as in a previous post but adds a use case to support email validation.  A Commons Validator object is ...

Saturday, February 5, 2011

[TUTORIAL] Converting Data Types with Talend Open Studio

Use tConvertType's Auto Cast to convert a batch of String fields to a more restrictive data type like Long.

12 comments:

  1. Can i use tConvertType to convert Time to String??

    ReplyDelete
    Replies
    1. Hi,

      Use a tMap with the Routine TalendDate.formatDate (String->Date) or Talenddate.parseDate (Date->String).

      For example, add this to a target field in a tMap

      TalendDate.formatDate("yyyy-MM-dd HH:mm:ss",row1.today_d )

      tConvertType is used for conversions between String, Double, Float, Long, Short, and Integer.

      Delete
    2. I manage to convert time to string (with tConvert)and back to time (in tMap)with this other row: Talenddate.parseDate("HH:mm:ss",row1.today_d)
      Thanks for replying :)

      Delete
  2. Thanks, nice post :-)

    Unfortunately I found a bug in tConvertType - https://jira.talendforge.org/browse/TDI-27516

    The tConvertType is unable to convert a string like "4,096" to an integer. When piping "Row, Rejects" to a .csv file I get errors like:

    "Memory:For input string: "4,096";Provisioned_MB:For input string: "55,297"

    ReplyDelete
  3. how to convert Bigdecimal to integer in talend????

    ReplyDelete
  4. Use the Bigdecimal's method intValueExact()

    ReplyDelete
  5. without tconverter how to change the datatype in talend

    ReplyDelete
  6. without tconverter how to change the datatype in talend

    ReplyDelete
    Replies
    1. Use a tMap or tJavaRow, putting a Java expression in for the conversion.

      Good luck

      Delete
  7. How to convert Data type Dynamic to String and String to Dynamic in talend

    ReplyDelete
  8. i have question can we convert number date to date format using tConverType component

    my incoming integer date is "01182019"

    ReplyDelete
  9. I need to convert a vlaue from bigdecimal to float i can?

    ReplyDelete