CAST, :: (Lakehouse v1)
Converts a value from one data type to another. :: is an alias for CAST.
See also: TRY_CAST
Analyze Syntax
Section titled “Analyze Syntax”func.cast( <expr>, <data_type> )Analyze Examples
Section titled “Analyze Examples”func.cast(1, string), func.to_string(1)
┌───────────────────────────────────────────┐│ func.cast(1, string) │ func.to_string(1) │├──────────────────────┼────────────────────┤│ 1 │ 1 │└───────────────────────────────────────────┘SQL Syntax
Section titled “SQL Syntax”CAST( <expr> AS <data_type> )
<expr>::<data_type>SQL Examples
Section titled “SQL Examples”SELECT CAST(1 AS VARCHAR), 1::VARCHAR;
┌───────────────────────────────┐│ cast(1 as string) │ 1::string │├───────────────────┼───────────┤│ 1 │ 1 │└───────────────────────────────┘