Skip to main content

ARRAY_SIZE

Returns the length of an array, counting NULL elements.

Alias: ARRAY_LENGTH

Syntax

ARRAY_SIZE(<array>)

Return Type

BIGINT

Examples

SELECT ARRAY_SIZE([1, 2, 3]) AS size_plain;

┌──────────┐
│ size_plain │
├──────────┤
3
└──────────┘
SELECT ARRAY_SIZE([1, NULL, 3]) AS size_with_null;

┌──────────────┐
│ size_with_null│
├──────────────┤
3
└──────────────┘
Explore Databend Cloud for FREE
Low-cost
Fast Analytics
Easy Data Ingestion
Elastic Scaling
Try it today