Convert Type
  • Dark
    Light

Convert Type

  • Dark
    Light

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.

Please Note

Users may experience casting errors if using binary values.

Matillion ETL uses the Redshift type system that includes: Text, Integer, Numeric, Real, Double Precision, Boolean, Date, and Datetime. The use of these database types is detailed in the Redshift documentation.

Matillion ETL uses the Snowflake type system that includes: VARCHAR, NUMBER, FLOAT, BOOLEAN, DATE, TIMESTAMP, TIME, and VARIANT. The use of these database types is detailed in the Snowflake documentation.

Matillion ETL uses the BigQuery type system that 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.

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

Property Setting Description
Name String A human-readable name for the component.
Conversions Column The column name from the input flow. Add as many rows to the editor as you need, one per input column.
Type Select either VARCHAR, NUMBER, FLOAT, BOOLEAN, DATE, TIMESTAMP, TIME, or VARIANT as the data type for this column.
Size Specify 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.
Precision The number of decimal places in NUMBER and VARCHAR types. The default is 0, indicating an integer.

Redshift Properties

Property Setting Description
Name String A human-readable name for the component.
Conversions Column The column name from the input flow. Add as many rows to the editor as you need, one per input column.
Data Type Text: 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...
Size The Size of the output field.
This is required for Text and Numeric types.
Precision The number of decimal places.
This is only required for Numeric and Real types.
Format The 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

Property Setting Description
Name String A human-readable name for the component.
Conversions Column The column name from the input flow. Add as many rows to the editor as you need, one per input column.
Type Select either String, Integer, Float, Boolean, Date, Time, DateTime, or Timestamp.

Synapse Properties

Property Setting Description
Name String A human-readable name for the component.
Conversions Column The column name from the input flow. Add as many rows to the editor as you need, one per input column.
Type Select the data type. Available types include DATE, DATETIME, TIME, INTEGER, NUMERIC, TEXT, FLOAT, BOOLEAN.
Size Define the size. For T-SQL, this is denoted as Precision. More...
Precision Define the precision. For T-SQL, this is denoted as Scale. More...

Delta Lake Properties

Property Setting Description
Name String A human-readable name for the component.
Conversions Column Name The column name from the input flow. Add as many rows to the editor as you need, one per input column.
Data Type Select from INTEGER, NUMBER, FLOAT, TEXT, TIMESTAMP, DATE, BOOLEAN, BINARY as the data type for this column.
Size Set the data type size.
Scale Set 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.