DURATION-NANOSECONDS is an elapsed time in signed nanoseconds with no epoch. It is not an instant or a calendar period of months or years.

ItemValue
NameDURATION-NANOSECONDS (spec document BIND DURATION-NANOSECONDS)
TAG ID0x081L
Codec ID0x00000810
Spec document0x00000000/codecs/0x00000810/ (DECLARE target 0810)
Section4 0100 (Value), offset within section C = 1
KindValue · family: TIME
TAG WORD0000 1000 0001 LLLL (000K KKKC CCCC LLLL)
Index descriptionElapsed time in signed nanoseconds with no epoch
Hugo pathvalue/time/duration-nanoseconds.md

Fields (spec document)

The order of FIELDs in the document is the order of Payload fields (Codec spec document).

OrderField (BIND)FIELDWidthAccepted format (CODEC)ENUM
1nanoseconds#2raw 4 WORDs

Layout

  • Code: Value direct code 0x081L. Family TIME.
  • It uses the same fixed-width signed int64 physical type as Arrow Duration(NANOSECOND).
TAG WORD          0x0814 (0000 1000 0001 0100)  5 WORDs in total
Payload WORD 1st (bits 63..48)     Signed Nanoseconds high 16 bits
Payload WORD 2nd (bits 47..32)     Signed Nanoseconds
Payload WORD 3rd (bits 31..16)     Signed Nanoseconds
Payload WORD 4th (bits 15..0)      Signed Nanoseconds low 16 bits

Interpretation and validity

  • Read all 4 Payload WORDs as a 64-bit two’s complement signed count in big-endian WORD order.
  • The valid range is -2^63 to 2^63-1 ns. The sign is the direction of elapsed time and does not point to an instant at a particular epoch.
  • Even small values always use 4 WORDs.

Length

  • The total is exactly 5 WORDs, the TAG 1 WORD plus the Payload 4 WORDs, and uses the direct length LLLL=0100. There is no Length extension TAG, descriptor, or padding.
  • If the Payload is not exactly 4 WORDs, it is rejected.

Examples

  • 0 ns is Payload 0000 0000 0000 0000, 5 WORDs in total, LLLL=0100. The whole is 0814 0000 0000 0000 0000.
  • 1 ns is Payload 0000 0000 0000 0001.
  • -1 ns is Payload FFFF FFFF FFFF FFFF.

Standards basis

  • The Apache Arrow Columnar Format designates Schema.fbs as the authoritative source of Arrow standard data types.
  • In the authoritative Arrow Schema.fbs, Duration is an absolute elapsed time independent of the calendar, supports the NANOSECOND unit, and is always represented as an 8-byte signed integer. GEUL adds only the TAG and big-endian 16-bit WORD framing.

Spec document source

This is the spec document 0x00000000/codecs/0x00000810/latest.geul as read with geul show (hex in uppercase).

SPEC-VERSION 0x0001
DOC-ID 0x0426000000000000081000000000
BODY
#1 DECLARE 0x0810
#2 FIELD #1 0x0004
#3 BIND #1 "DURATION-NANOSECONDS"
#4 BIND #2 "nanoseconds"