Convert Type
    • Dark
      Light

    Convert Type

    • Dark
      Light

    Article Summary

    Convert Type Component

    Convert the data types of the input flow.

    If possible, it is better to change the source data so that it already has the correct types. However, sometimes it is necessary to convert the types explicitly.

    Snowflake: Types includes: VARCHAR, NUMBER, FLOAT, BOOLEAN, DATE, TIMESTAMP, TIME, and VARIANT. The use of these database types is detailed in the Snowflake documentation.

    Redshift: Types includes: Text, Integer, Numeric, Real, Double Precision, Boolean, Date, and Datetime. The use of these database types is detailed in the Redshift documentation.

    BigQuery: Type includes: String, Integer, Float, Boolean, Date, Time, Datetime, and Timestamp. The use of these database types is detailed in the BigQuery documentation.

    Important Information

    • When appropriate, values are first rounded to the requested decimal places before being cast to the requested size.
    • Users may experience casting errors if using binary values.
    • Although syntax is checked at validation time, runtime errors may occur during type-conversion if the input data cannot fit into the requested target type.



    Properties

    Snowflake Properties

    PropertySettingDescription
    NameStringA human-readable name for the component.
    ConversionsColumnThe column name from the input flow. Add as many rows to the editor as you need, one per input column.
    TypeSelect either VARCHAR, NUMBER, FLOAT, BOOLEAN, DATE, TIMESTAMP, TIME, or VARIANT as the data type for this column.
    SizeSpecify the number of digits in the NUMBER and VARCHAR data types. Values may be between 0 and 38. If left incomplete, Snowflake will default to 38 digits.
    PrecisionThe number of decimal places in NUMBER and VARCHAR types. The default is 0, indicating an integer.

    Redshift Properties

    PropertySettingDescription
    NameStringA human-readable name for the component.
    ConversionsColumnThe column name from the input flow. Add as many rows to the editor as you need, one per input column.
    Data TypeText: this type can hold any kind of data, subject to a maximum size. More...
    Integer: this type is suitable for whole-number types (no decimals). More...
    Numeric: this type is suitable for numeric types, with or without decimals. More...
    Real: this type is suitable for data of a single precision floating-point number. More...
    Double Precision: this type is suitable for data of a double precision floating-point number. More...
    Boolean: this type is suitable for data that is either 'true' or 'false'. More...
    Date: this type is suitable for dates without times. More...
    DateTime: this type is suitable for dates, times, or timestamps (both date and time). More...
    SUPER: use the SUPER data type to store semi-structured data or documents as values. More...
    SizeThe Size of the output field.
    This is required for Text and Numeric types.
    PrecisionThe number of decimal places.
    This is only required for Numeric and Real types.
    FormatThe DateTime format
    This is only required if the Type is set to Date or DateTime.
    If your input column is Text and you want to convert to Date / Datetime, specify the input format of the input column.
    For an exhaustive list of possible formats, see the Amazon Redshift Documentation.

    BigQuery Properties

    PropertySettingDescription
    NameStringA human-readable name for the component.
    ConversionsColumnThe column name from the input flow. Add as many rows to the editor as you need, one per input column.
    TypeSelect either String, Integer, Float, Boolean, Date, Time, DateTime, or Timestamp.

    Synapse Properties

    PropertySettingDescription
    NameStringA human-readable name for the component.
    ConversionsColumnThe column name from the input flow. Add as many rows to the editor as you need, one per input column.
    TypeSelect the data type. Available types include DATE, DATETIME, TIME, INTEGER, NUMERIC, TEXT, FLOAT, BOOLEAN.
    SizeDefine the size. For T-SQL, this is denoted as Precision. More...
    PrecisionDefine the precision. For T-SQL, this is denoted as Scale. More...

    Delta Lake Properties

    PropertySettingDescription
    NameStringA human-readable name for the component.
    ConversionsColumn NameThe column name from the input flow. Add as many rows to the editor as you need, one per input column.
    Data TypeSelect from INTEGER, NUMBER, FLOAT, TEXT, TIMESTAMP, DATE, BOOLEAN, BINARY as the data type for this column.
    SizeSet the data type size.
    ScaleSet the data type scale.

    Strategy

    Generates a select clause, casting column types.



    Example

    This job changes two input text columns into numeric columns.

    The metadata for the input data shows all inputs are "text".

    A Convert Type component is configured. Only a name and a list of conversions are required.

    The conversions request two fields to be converted to "numeric", with no decimal places.

    The metadata for the Convert Type component confirms the types have been converted.