toFloatArray

Cast an array column to float array type.

Usage Details

select *, toFloatArray(column) as floatArrayColumn from tableName

Input Parameters:
column: An array column

Output:
A column floatArrayColumn which is same as column but each element in each row casted to float data type.

Example

Input Table: input_table

column
WrappedArray("3.45", "15")
WrappedArray("178.90", "-45.78")
select *, toFloatArray(column) as floatArrayColumn from input_table

Ouput:

columnfloatArrayColumn
WrappedArray("3.45", "15")WrappedArray(3.45, 15)
WrappedArray("178.90", "-45.78")WrappedArray(178.90, -45.78)

© Devo Technology Inc. All Rights Reserved.