All Products
Search
Document Center

Conversion functions

Last Updated: Mar 22, 2021

Data Lake Analytics (DLA) implicitly converts numeric and character values into the correct type. DLA does not automatically convert between character and numeric types. For example, DLA cannot automatically convert data of the Long type returned from a query into data of the VARCHAR type.

Conversion functions

cast(value AS type) → type

This function explicitly converts a value into a type. It can be used to convert a character value into a numeric type, or a numeric value into a character type.

Miscellaneous

typeof(expr) → varchar

Types of return results of expressions:

SELECT typeof(123); -- integer

SELECT typeof('cat'); -- varchar(3)

SELECT typeof(cos(2) + 1.5); -- double