cast (input as BIGINT) converts the input into a BIGINT value.
From v2.4, the database supports conversion to the ARRAY type.
Note
CAST(input AS CHAR(N)) truncates the result to the first N characters, consistent with MySQL. For example, CAST(1775580223839 AS CHAR(10)) returns 1775580223. CAST(input AS CHAR) without a length and CAST(input AS VARCHAR(N)) are not truncated.
Syntax
Parameters
input: the data you want to convert.
type: the destination data type.
Return value
Returns a value whose data type is the same astype.
Examples
Example 1: common data conversionsText
:: shorthand.
Text
:: is equivalent to CAST(input AS type) and uses the database cast semantics.
Warning
If a view or materialized view DDL uses ::, the saved original definition can contain ::. Such definitions are not backward compatible with older versions or tools that do not parse the shorthand syntax.
Example 3: Convert the input into ARRAY.
Text
Note If the original value is a floating-point value (such as 12.0), it will be converted to NULL. If you want to forcibly convert this type into BIGINT, see the following example:
text