Defining Data Type conversion for mapped fields

Spectrum Technology Platform automatically changes field data types as needed using the type conversion settings specified in Management Console, or through the dataflow type conversion options specified in Flow Designer.

In most situations you do not need to manually change field data types because any necessary data type conversions are handled automatically. However, in cases where a stage is unable to convert incoming data to the necessary data type, you may need to manually change the data type in the upstream channel.

There are a limited number of type conversions that you can perform manually:
  • Polygon and MultiPolygon types can be converted to and from a geometry type.
  • Date, time, and datetime data types can be converted to and from a string type.
To manually change a field data type, follow this procedure.
  1. In Flow Designer, double-click the channel where you want to change the field's data type. A channel is the line that connects two stages on the canvas.
    This displays field mappings between output fields in the upstream stage and input fields in the downstream stage. A dashed line indicates a data type change.
  2. Double-click the mapping that you want to configure.
    If type conversion options are configurable for the mapped fields, this expands the Type Conversion Options panel.
    Note: The panel displays the appropriate options depending on the data type.
  3. Click to toggle Override type conversion options to ON.
  4. In the Locale field, select the country whose format you want to use for dates converted to a string.
    Your selection will determine the default values for the date, time, and datetime field types. Your selection will also determine the language used when a month or day is spelled out. For example, if you specify English the first month of the year would be "January" but if you specify Spanish it would be "Enero".
  5. In the Format field, specify the format you want to use for date, time, date and time, or numeric data that is converted to a string.
    When the data, time, date and time, or numeric data is converted to a string, the string value will be in the format you specify here.
    Field typeDo this
    Date

    Select the format to use for date data when it is converted to a string. A list of the most commonly used formats for the selected locale is provided.

    For example, if you choose the format M/D/YY and a date field contains 2020-3-2, that date data would be converted to the string 3/2/20.

    Time

    Select the format to use for time data when it is converted to a string. A list of the most commonly used formats for the selected locale is provided.

    For example, if you choose the format h:mm a and a time field contains 23:00, that time data would be converted to the string 11:00 PM.

    DateTime

    Select the format to use for fields containing the DateTime data type when converted to a string. A list of the most commonly used formats for the selected locale is provided.

    For example, if you choose the format M/d/yy h:mm a and a DateTime field contains 2020-3-2 23:00, that DateTime data would be converted to the string 3/2/20 11:00 PM.

    Whole numbers

    Select the formatting you want to use for whole numbers (data-types float and double).

    For example, if you choose the format #,### then the number 4324 would be formatted as 4,324.

    If you leave this field blank, no thousands separator is used, the dot (".") is used as the decimal separator, numbers less than 10-3 or greater than or equal to 107 are shown in scientific notation, and negative numbers have a minus sign ("-") in front of them. Also note that if you leave this field blank, numbers that use the bigdecimal data type will always be in the format #,###.000

    Decimal numbers

    Select the formatting you want to use for numbers that contain a decimal value (data-types integer and long).

    For example, if you choose the format #,##0.0# then the number 4324.25 would be formatted as 4,324.25.

    If you leave this field blank, no thousands separator is used, the dot (".") is used as the decimal separator, numbers less than 10-3 or greater than or equal to 107 are shown in scientific notation, and negative numbers have a minus sign ("-") in front of them. Also note that if you leave this field blank, numbers that use the bigdecimal data type will always be in the format #,###.000

    You can also specify your own date, time, and number formats if the ones available for selection do not meet your needs. To specify your own date or time format, type the format into the field using the notation described in Date and time patterns. To specify your own number format, type the format into the file using the notation described in Number Patterns.

  6. Click OK.

    The color of the data type name changes to green.

  7. Click Apply, then the Save button on the toolbar to save the change.