Types
Types
Chunk Headers, Timeseries Metadata, and Table Schemas use a single-byte data_type identifier:
| Value | Name | Physical or logical meaning |
|---|---|---|
| 0 | BOOLEAN | Boolean value |
| 1 | INT32 | Signed 32-bit integer |
| 2 | INT64 | Signed 64-bit integer |
| 3 | FLOAT | IEEE 754 binary32 |
| 4 | DOUBLE | IEEE 754 binary64 |
| 5 | TEXT | Length-prefixed byte string |
| 6 | VECTOR | Physical type marker used by an aligned Time Chunk |
| 7 | UNKNOWN | Unknown type marker |
| 8 | TIMESTAMP | Signed 64-bit integer; the upper layer defines the time unit |
| 9 | DATE | Signed 32-bit integer in decimal YYYYMMDD form |
| 10 | BLOB | Arbitrary byte string |
| 11 | STRING | UTF-8 string |
| 12 | OBJECT | Byte representation of an object value |
For example, the physical DATE value for 2026-07-27 is the decimal integer 20260727, not a Unix epoch day.
The data type determines the additional Statistics fields and the input type of the value encoder. See Encodings for wire representations of values.
Physical and Logical Types
A data type describes the value domain; the encoding determines how those values become bytes. TIMESTAMP and DATE also assign a meaning to the underlying integer:
TIMESTAMPhas the same signed 64-bit value domain asINT64. The time unit is supplied by the protocol or dataset using the file; TsFile v4 does not serialize that unit.DATEhas the same integer encoder interface asINT32, but valid logical values use decimalYYYYMMDDform.TEXTis a length-delimited byte string.STRINGuses the same physical binary container but has UTF-8 string semantics.BLOBis uninterpreted binary data.OBJECTstores object bytes. The applications exchanging the file agree on how to reconstruct an object from them.
VECTOR is a physical marker for the shared time column of aligned data. It is not a scalar value type and does not define a standalone value-stream encoding. UNKNOWN is a sentinel, not a valid type for a decodable measurement Page.
Type Consistency
The same series type is repeated at different levels so a reader can enter the file through the footer or through a sequential scan. These copies must agree:
- A non-aligned or aligned Value Chunk Header uses the measurement's scalar
data_type. - Its Timeseries Metadata uses the same
data_type. - Statistics are decoded using that type and contain no independent type byte.
- An aligned Time Chunk uses
VECTOR; its decoded values are signed 64-bit timestamps.
Changing the interpretation of a previously assigned identifier is incompatible. A reader that does not support a type identifier may still skip a complete Chunk using data_size, but it cannot decode values or type-specific Statistics for that series.
Ordering and Comparison
Integer and floating-point values use their numeric order for min/max Statistics. STRING min/max values compare their raw value bytes lexicographically, excluding length prefixes. TEXT stores only first and last values, while BLOB and OBJECT store no type-specific value Statistics.
Type promotion and application-level casts are not encoded in TsFile. A reader can expose such conversions, but they do not change the stored data_type or the bytes used to compute Statistics.