Arrays store ordered collections of elements of the same type.
from typing import List class User(BaseModel): tags: List[str] # Array(String) scores: List[float] # Array(Float64) ids: List[int] # Array(Int64) flags: List[bool] # Array(Boolean)Arrays can contain complex types like JSON or tuples.
from typing import List, Dict, Any, Tuple class Event(BaseModel): metadata: List[Dict[str, Any]] # Array(Json) points: List[Tuple[float, float]] # Array(Tuple)| 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)).