Table of contents

CAST (Azure Stream Analytics)

Mary McCready|Last Updated: 10/5/2018
|
1 Contributor

Converts an expression of one data type to another within the supported data types in Stream Analytics Query Language.

If the conversion cannot be performed, the function fails and causes the job to stop. For example, the clause CAST ('this is a string' AS bigint) results in a job failure since the input string cannot be converted into the bigint data type. To avoid type cast failures, use TRY_CAST function instead.

Syntax

CAST ( expression AS data_type)  
  

Arguments

expression

Is any valid expression.

data_type

Is the target data type supported by Stream Analytics Query Language.

Return Types

Returns expression translated to data_type.

Examples

  
SELECT TollId, EntryTime, LicensePlate, State, Make   
FROM Input TIMESTAMP BY EntryTime  
WHERE CAST( TollId AS bigint) > 2  
  

See also

For more information on Stream Analytics data types, see:

© 2018 Microsoft