Lists
A list is an ordered collection that can contain duplicate elements.Basic Usage
List Operations
List of Various Types
Sets
A set is an unordered collection of unique elements.Basic Usage
Reading Sets
Set Operations
Maps
A map is an unordered collection of key-value pairs.Basic Usage
Reading Maps
Map Operations
Maps with Different Value Types
Vectors
A vector is a fixed-size list of elements of the same type. Unlike lists, vectors have a predefined dimension.Basic Usage
Vector Dimensions
The vector dimension is part of the type and must match:Vector Operations
Vectors are commonly used for similarity search:Nested Collections
Collections can contain other collections if the inner collection is frozen.List of Lists
Map of Lists
Empty Collections
Nullable Collections
Performance Considerations
Collection Size
Collections have size limits:- Maximum recommended size: ~64KB per collection
- Very large collections can impact performance
- Consider using multiple rows instead of large collections
Frozen Collections
Frozen collections are more efficient but cannot be partially updated:Common Patterns
Using Sets for Membership Testing
Using Maps for Attributes
Time-Series Data with Lists
Best Practices
- Keep collections small: Large collections can cause performance issues
- Use sets for uniqueness: When order doesn’t matter and you need unique elements
- Use frozen for nested collections: Required for collections within collections
- Avoid reading entire large collections: Use secondary indexes or query by specific elements
- Consider denormalization: Sometimes multiple rows are better than large collections
See Also
- Primitive Types - Element types for collections
- User-Defined Types - Collections of UDTs
- Data Types Overview - Type system overview
