CAST (Azure Stream Analytics)

 

Updated: July 19, 2016

Applies To: Azure

Converts an expression of one data type to another within the supported types in Stream Analytics Query Language. This will fail and cause the job to stop if the conversion cannot be performed.

For example, CAST ('this is a string' AS bigint) will result in a job failure. When this is not a desired outcome use TRY_CAST (Azure Stream Analytics) instead.

Syntax

CAST ( expression AS data_type)  
  

expression

Is any valid expression.

data_type

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

Returns expression translated to data_type.

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

Show: