expression: Expression to cast.
Can be a constant, column, or function, and any combination of arithmetic or
string operators.
datatype: Arrow data type name
to cast to, as a string. The format is the same as that returned by [arrow_typeof]
Example
Copy
> select arrow_cast(-5, 'Int8') as a, arrow_cast('foo', 'Dictionary(Int32, Utf8)') as b, arrow_cast('bar', 'LargeUtf8') as c, arrow_cast('2023-01-02T12:53:02', 'Timestamp(Microsecond, Some("+08:00"))') as d ;+----+-----+-----+---------------------------+| a | b | c | d |+----+-----+-----+---------------------------+| -5 | foo | bar | 2023-01-02T12:53:02+08:00 |+----+-----+-----+---------------------------+1 row in set. Query took 0.001 seconds.