Skip to main content
The Convert Type transformation component lets you change the data types of the input flow by generating a SELECT clause that casts column types to a new specified type. If possible, it’s better to change the source data so that it already has the correct types. However, sometimes it’s necessary to convert the types explicitly.
  • Snowflake types include: VARCHAR, NUMBER, FLOAT, BOOLEAN, DATE, TIMESTAMP, TIME, and VARIANT. The use of these data types is detailed in the Snowflake documentation.
  • Databricks types include: INTEGER, NUMBER, FLOAT, TEXT, TIMESTAMP, DATE, BOOLEAN, and BINARY. The use of these data types is detailed in the Databricks documentation.
  • Amazon Redshift types include: TEXT, INTEGER, NUMERIC, REAL, DOUBLE PRECISION, BOOLEAN, DATE, DATETIME, and SUPER. The use of these data types is detailed in the Amazon Redshift documentation.
  • Google BigQuery types include: STRING, INT64, FLOAT64, NUMERIC, BIGNUMERIC, BOOL, BYTES, DATE, DATETIME, TIME, TIMESTAMP, and INTERVAL. The use of these data types is detailed in the Google BigQuery documentation.
  • 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.

Use case

This component is useful when you need to ensure that the data types in your dataset match the requirements of your cloud data warehouse or when you want to standardize data types across different datasets. For example, you might use this component to:
  • Standardize data types across multiple datasets for auditing and regulation.
  • Align mismatched types across disparate systems for downstream join or merge operations.
  • Convert string representations of dates or numbers into their respective date or numeric types for accurate calculations and comparisons.

Properties

Name
string
required
A human-readable name for the component.
Conversions
column editor
required
Enter the following details for each table column:
  • Column: The name of the column to convert.
  • Type: The type to cast the column to.
  • Size: For Text types, this is the maximum length. This is a limit on the number of bytes, not characters. For Numeric types, this is the total number of digits allowed, whether before or after the decimal point.
  • Precision: The precision of the data in the column. Will be 0 (zero) for non-applicable types.
TypeDescription
VarcharSuitable for numbers and letters. A varchar or Variable Character Field is a set of character data of indeterminate length.
NumberSuitable for numeric types, with or without decimals.
FloatApproximate numeric values with fractional components.
BooleanSuitable for data that is either “true” or “false”, or “1” or “0”, respectively.
DateSuitable for dates without times.
TimestampA timestamp left unformatted (exists as Unix/Epoch Time).
TimeSuitable for time, independent of a specific date and timezone.
VariantA tagged universal type that can hold up to 16 MB of any data type supported by Snowflake.
To use grid variables, toggle Use Grid Variable on at the bottom of the dialog. For more information, read Grid variables.Click the Text mode toggle at the bottom of the dialog to open a multi-line editor that lets you add items in a single block. For more information, read Text mode.