Arrays store ordered collections of elements of the same type.
interface User { tags: string[]; // Array(String) scores: number[]; // Array(Float64) ids: Int32[]; // Array(Int32) flags: boolean[]; // Array(Boolean)}Arrays can contain complex types like JSON or tuples.
import { ClickHouseNamedTuple } from "@514labs/moose-lib"; interface Event { metadata: Record<string, any>[]; // Array(Json) points: { x: number; y: number; }[]; // Array of nested objects}| ClickHouse Type | TypeScript | Python |
|---|---|---|
Array(String) | string[] | List[str] |
Array(Float64) | number[] | List[float] |
Array(Int32) | Int32[] |
List[int] |
Array(Boolean) | boolean[] | List[bool] |
Array(Json) | Record<string, any>[] | List[Dict[str, Any]] |
You can nest arrays to create multi-dimensional structures: number[][] maps to Array(Array(Float64)).