Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

A tuple field is a sequence of bytes. This sequence is interpreted according to the associated data type provided by the tuple schema. There are different encoding rules for different values. The For some data types the rules include a very simple compression mechanism. So even if the original type has some fixed size when it is it may take different number of bytes when encoded as a tuple field it may occupy variable number of bytes.

If a value is equal to NULL then it is absent in the value area. This means that in the offset table the corresponding entry is equal to the previous entry. At the same time the corresponding bit in the nullmap is set.

For any variable-length type we can encounter a value with zero length. Again the length is determined by the offset table. Quite naturally a zero-length variable-length value translates to a zero-length field in a tuple. This approach is extended to fixed-size types by introducing a notion of default values. We define specific default values for different types (specified in the table below). If a given value is equal to the corresponding default value then this translates to a zero-length field in a tuple.

...

The list of supported data types is as follows:

TypeField SizeDefault ValueDescription
Int810
Int161-, 20

Int32

1-, 2, 40
Int641-, 2, 4, 80
Float40.0
Double4, 80.0
Numbervariable0
Decimalvariable0
UUID1600000000-0000-0000-0000-000000000000
Stringvariableempty string
Binaryvariableempty binary
Bitmaskvariableempty bit-string
Date3

Jan 1, 1 BC for date (1 BC immediately

precedes 1 AD in the Gregorian calendar)


Time4-, 5, 600:00:00.000000
DateTime7-, 8, 9Jan 1, 1 BC, 00:00:00.000000

Timestamp8, 12Jan 1, 1970 00:00:00.000000
Duration8, 120 (PT0S)
Period3, 6, 120 (P0D)
Boolean1false

...