Map Types
Maps store key-value pairs with specified key and value types.
Usage
interface User { preferences: Record<string, string>; // Map(String, String) metrics: Record<string, number>; // Map(String, Float64) settings: Record<string, boolean>; // Map(String, Boolean)}Type Mapping Reference
| ClickHouse Type | TypeScript | Python |
|---|---|---|
Map(String, String) | Record<string, string> | Dict[str, str] |
Map(String, Float64) | Record<string, number> | Dict[str, float] |
Map(String, Int64) | Record<string, Int64> | Dict[str, int] |
Map(String, Boolean) | Record<string, boolean> | Dict[str, bool] |
Key types
Map keys must be String, Int*, or UInt* types. String keys are most common.
When to use Map vs JSON
Use Map when all values have the same type and you need efficient key lookups. Use JSON when values have mixed types or the structure is highly dynamic.