...
Type | Field Size | Default Value | Description | ||||
---|---|---|---|---|---|---|---|
Int8 | 1 | 0 | 1-byte signed integer | ||||
Int16 | 1, 2 | 0 | 2-byte signed integer, but may occupy less space due to compression mechanism described below | ||||
Int32 | 1, 2, 4 | 0 | 4-byte signed integer, but may occupy less space due to compression mechanism described below | ||||
Int64 | 1, 2, 4, 8 | 0 | 8-byte signed integer, but may occupy less space due to compression mechanism described below | ||||
Float | 4 | 0.0 | 4-byte floating-point number | ||||
Float | 4 | 0.0 | Double | 4, 8 | 0.0 | 8-byte floating-point number, but may occupy less space due to compression mechanism described below | |
Number | variable | 0 | Variable-length integer | ||||
Decimal | variable | 0 | Decimal | variable | 0 | Variable-length fixed-point number, the scale is determined by the schema though it is stored with the number | |
UUID | 16 | 00000000-0000-0000-0000-000000000000 | UUID | ||||
String | variable | empty string | An utf-8 encoded string | ||||
Binary | variable | empty binary | Variable-length arbitrary binary data | ||||
Bitmask | variable | empty bit-string | Variable-length binary data representing a bit-string | ||||
Date | 3 |
1 AD in the Gregorian calendar) | A timezone-free date (a year, month, day) | ||||
Time | 4, 5, 6 | 00:00:00.000000 | A timezone-free time (hour, minute, second, microseconds) | ||||
DateTime | 7, 8, 9 | Jan 1, 1 BC, 00:00:00.000000 | A timezone-free datetime encoded as (date, time) | ||||
Timestamp | 8, 12, 12 | Jan 1, 1970, 00:00:00.000000 | Number of microseconds since Jan 1, 1970 00:00:00.000000 (with no timezone) | ||||
Duration | 8, 12 | 0 (PT0S) | See below | ||||
Period | 3, 6, 12 | 0 (P0D) | See below | ||||
Boolean | 1 | false |
...
A boolean value (either true of false ) |
All integer values are stored in the little-endian byte order.
Uniform use of offset tables for all fields lets us take advantage of variable-length principle for integer fields.
little-endian byte order.
For Thus for integer values it is possible to keep only their significant bytes, omitting their high insignificant bytes. That is even if the original data type of a field is INTEGER and should occupy 4 bytes but the actual value is below 128
and above -129
then we can store it just as a single byte and reflect this in the offset table.
...
In SQL standard there are no unsigned integers. So their support may be is omitted for now. But should it become needed for some reason then a compressed unsigned integer must be zero-extended on decompression.
...
Unlike Date, every part is independent from others and can be in range from Integer.MIN_VALUE to Integer.MAX_VALUE.
A single byte containing 1
for the value of true
. The value of false
does not need any representation as it stored as a default zero-size field.
If the number of fields is N and t is an array that stores a binary tuple we can find the answers for the following:
...