UNSAFE_CAST

All functions > CORE > UNSAFE_CAST

Returns the given expression casted to the given type, or raise an exception if the conversion fails.

Signatures

Returns: The expression converted to the specified type, or NULL if conversion fails

UNSAFE_CAST(expr: T, as_type: DataTypeEnum.TYPE) → U
sql
ParameterTypeRequiredDescription
exprTYesThe expression to convert
as_typeDataTypeEnum.TYPEYesThe target data type

Notes

  • Same as CAST but allowing to change or remove entity type

Examples

FeatureQL
SELECT
    f1 := UNSAFE_CAST('123' AS BIGINT)  -- Valid string to integer
;
Result
f1 BIGINT
123

Last update at: 2026/03/03 16:47:38
Last updated: 2026-03-03 16:48:19