Data types¶
Data types define how values are stored and processed in a database. They determine what kind of data can be stored in a column (like numbers, text, dates, etc.), how much storage space the data will use, and what operations can be performed on the values. Choosing the right data type is important for both data integrity and query performance.
Each column in a table must have a specified data type that matches the kind of data you plan to store. For example, you would use numeric types for calculations, string types for text, and date/time types for temporal data.
The following data types are supported:
- AggregateFunction
- Array
- Bool
- Date
- Date32
- DateTime
- DateTime64
- Decimal
- Enum
- FixedString
- Float
- Geographical Data Types
- Integer and Unsigned Integer
- Interval
- IPv4
- IPv6
- JSON
- LowCardinality
- Map
- Nothing
- Nullable
- SimpleAggregateFunction
- String
- Tuple
- UUID
If you are ingesting using the NDJSON format and would like to store Decimal
values containing 15 or more digits, send the values as string instead of numbers to avoid precision issues. In the following example, the first value has a high chance of losing accuracy during ingestion, while the second one is stored correctly:
{"decimal_value": 1234567890.123456789} # Last digits might change during ingestion {"decimal_value": "1234567890.123456789"} # Will be stored correctly