Skip to content

Files

Latest commit

1cad37d · Feb 4, 2022

History

History
68 lines (59 loc) · 7.31 KB

data-flow-conversion-functions.md

File metadata and controls

68 lines (59 loc) · 7.31 KB
title titleSuffix description author ms.author ms.service ms.subservice ms.custom ms.topic ms.date
Conversion functions in the mapping data flow
Azure Data Factory & Azure Synapse
Learn about conversion functions in mapping data flow.
kromerm
makromer
data-factory
data-flows
synapse
conceptual
02/02/2022

Conversion functions in mapping data flow

[!INCLUDEappliesto-adf-asa-md]

[!INCLUDEdata-flow-preamble]

The following articles provide details about expressions and functions supported by Azure Data Factory and Azure Synapse Analytics in mapping data flows.

Conversion function list

Conversion functions are used to convert data and test for data types

Conversion function Task
isBitSet Checks if a bit position is set in this bitset
setBitSet Sets bit positions in this bitset
isBoolean Checks if the string value is a boolean value according to the rules of toBoolean()
isByte Checks if the string value is a byte value given an optional format according to the rules of toByte()
isDate Checks if the input date string is a date using an optional input date format. Refer to Java's SimpleDateFormat for available formats. If the input date format is omitted, default format is yyyy-[M]M-[d]d. Accepted formats are [ yyyy, yyyy-[M]M, yyyy-[M]M-[d]d, yyyy-[M]M-[d]dT* ]
isShort Checks if the string value is a short value given an optional format according to the rules of toShort()
isInteger Checks if the string value is an integer value given an optional format according to the rules of toInteger()
isLong Checks if the string value is a long value given an optional format according to the rules of toLong()
isNan Check if a value isn't a number.
isFloat Checks if the string value is a float value given an optional format according to the rules of toFloat()
isDouble Checks if the string value is a double value given an optional format according to the rules of toDouble()
isDecimal Checks if the string value is a decimal value given an optional format according to the rules of toDecimal()
isTimestamp Checks if the input date string is a timestamp using an optional input timestamp format. Refer to Java's SimpleDateFormat for available formats. If the timestamp is omitted, the default pattern yyyy-[M]M-[d]d hh:mm:ss[.f...] is used. You can pass an optional timezone in the form of 'GMT', 'PST', 'UTC', 'America/Cayman'. Timestamp supports up to millisecond accuracy with value of 999 Refer to Java's SimpleDateFormat for available formats.
toBase64 Encodes the given string in base64.
toBinary Converts any numeric/date/timestamp/string to binary representation.
toBoolean Converts a value of ('t', 'true', 'y', 'yes', '1') to true and ('f', 'false', 'n', 'no', '0') to false and NULL for any other value.
toByte Converts any numeric or string to a byte value. An optional Java decimal format can be used for the conversion.
toDate Converts input date string to date using an optional input date format. Refer to Java's SimpleDateFormat class for available formats. If the input date format is omitted, default format is yyyy-[M]M-[d]d. Accepted formats are :[ yyyy, yyyy-[M]M, yyyy-[M]M-[d]d, yyyy-[M]M-[d]dT* ].
toDecimal Converts any numeric or string to a decimal value. If precision and scale aren't specified, it's defaulted to (10,2). An optional Java decimal format can be used for the conversion. An optional locale format in the form of BCP47 language like en-US, de, zh-CN.
toDouble Converts any numeric or string to a double value. An optional Java decimal format can be used for the conversion. An optional locale format in the form of BCP47 language like en-US, de, zh-CN.
toFloat Converts any numeric or string to a float value. An optional Java decimal format can be used for the conversion. Truncates any double.
toInteger Converts any numeric or string to an integer value. An optional Java decimal format can be used for the conversion. Truncates any long, float, double.
toLong Converts any numeric or string to a long value. An optional Java decimal format can be used for the conversion. Truncates any float, double.
toShort Converts any numeric or string to a short value. An optional Java decimal format can be used for the conversion. Truncates any integer, long, float, double.
toString Converts a primitive datatype to a string. For numbers and date, a format can be specified. If unspecified the system default is picked.Java decimal format is used for numbers. Refer to Java SimpleDateFormat for all possible date formats; the default format is yyyy-MM-dd.
toTimestamp Converts a string to a timestamp given an optional timestamp format. If the timestamp is omitted the default pattern yyyy-[M]M-[d]d hh:mm:ss[.f...] is used. You can pass an optional timezone in the form of 'GMT', 'PST', 'UTC', 'America/Cayman'. Timestamp supports up to millisecond accuracy with value of 999. Refer to Java's SimpleDateFormat class for available formats. https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html.
toUTC Converts the timestamp to UTC. You can pass an optional timezone in the form of 'GMT', 'PST', 'UTC', 'America/Cayman'. It's defaulted to the current timezone. Refer to Java's SimpleDateFormat class for available formats. https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html.

Next steps