CAST, :: (Lakehouse v1)
Converte um valor de um tipo de dados para outro. :: é um alias de CAST.
Veja também: TRY_CAST
Sintaxe do Analyze
Seção intitulada “Sintaxe do Analyze”func.cast( <expr>, <data_type> )Exemplos do Analyze
Seção intitulada “Exemplos do Analyze”func.cast(1, string), func.to_string(1)
┌───────────────────────────────────────────┐│ func.cast(1, string) │ func.to_string(1) │├──────────────────────┼────────────────────┤│ 1 │ 1 │└───────────────────────────────────────────┘Sintaxe SQL
Seção intitulada “Sintaxe SQL”CAST( <expr> AS <data_type> )
<expr>::<data_type>Exemplos de SQL
Seção intitulada “Exemplos de SQL”SELECT CAST(1 AS VARCHAR), 1::VARCHAR;
┌───────────────────────────────┐│ cast(1 as string) │ 1::string │├───────────────────┼───────────┤│ 1 │ 1 │└───────────────────────────────┘