NULL()

All functions > CORE > NULL()

Returns a NULL value of the given type.

Signatures

Returns: A NULL value of the specified type

NULL([type: DataTypeEnum.TYPE]) → T
sql
ParameterTypeRequiredDescription
typeDataTypeEnum.TYPENoThe data type for the NULL value

Notes

  • Creates a typed NULL value
  • If no type specified, defaults to VARCHAR
  • Useful for providing explicit NULL values in expressions
  • Type parameter ensures proper type inference in complex queries
  • NULL values propagate through most operations
  • Can be used to initialize optional fields or provide default values

See also

Examples

Typed NULL

FeatureQL
SELECT
    f1 := COALESCE(NULL(BIGINT), 7), -- NULL(BIGINT) carries BIGINT so COALESCE can fill in a default
    f2 := (NULL(BIGINT) IS NULL::BIGINT) = TRUE -- Explicit typed NULL compares with IS NULL
;
Result
f1 BIGINTf2 BOOLEAN
7true

Default type when omitted

FeatureQL
SELECT
    f1 := TYPEOF(NULL()) -- NULL() without a type is an unspecified NULL in FeatureQL typing
;
Result
f1 VARCHAR
UNSPECIFIED

Last update at: 2026/05/26 17:22:09