You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/format/CanonicalExtensions.rst
+12-2Lines changed: 12 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -555,9 +555,9 @@ This extension type is intended to be compatible with ANSI SQL's ``TIMESTAMP WIT
555
555
556
556
* The storage type of the extension is a ``Struct`` with 2 fields, in order:
557
557
558
-
* ``timestamp``: a non-nullable ``Timestamp(time_unit, "UTC")``, where ``time_unit`` is any Arrow ``TimeUnit`` (s, ms, us or ns).
558
+
* ``timestamp``: a preferably non-nullable ``Timestamp(time_unit, "UTC")``, where ``time_unit`` is any Arrow ``TimeUnit`` (s, ms, us or ns).
559
559
560
-
* ``offset_minutes``: a non-nullable signed 16-bit integer (``Int16``) representing the offset in minutes from the UTC timezone. Negative offsets represent time zones west of UTC, while positive offsets represent east. Offsets range from -779 (-12:59) to +780 (+13:00).
560
+
* ``offset_minutes``: a preferably non-nullable signed 16-bit integer (``Int16``) representing the offset in minutes from the UTC timezone. Negative offsets represent time zones west of UTC, while positive offsets represent east. Offsets range from -779 (-12:59) to +780 (+13:00).
561
561
562
562
* Extension type parameters:
563
563
@@ -571,6 +571,16 @@ This extension type is intended to be compatible with ANSI SQL's ``TIMESTAMP WIT
571
571
572
572
It is also *permissible* for the ``offset_minutes`` field to be dictionary-encoded with a preferred (*but not required*) index type of ``int8``, or run-end-encoded with a preferred (*but not required*) runs type of ``int8``.
573
573
574
+
.. note::
575
+
576
+
It is also *permissible* ``timestamp`` and ``offset_minutes`` to be nullable, even though it is not preferred.
577
+
578
+
If ``timestamp`` is nullable and a value is found to be null, then the whole ``TimestampWithOffset`` value should be interpreted as null. One way of achieving this is to drop ``timestamp``'s validity buffer (V1) and replace the top-level struct validity buffer (V2) with the result of ``V1 AND V2``.
579
+
580
+
If ``offset`` is nullable and a value is found to be null, then this value should be interpreted as if the offset value were were zero.
581
+
582
+
It is *recommended* that implementations normalize this type's representation by dropping the inner validity buffers and applying the aforementioned transformations, only keeping the top-level struct validity buffer.
583
+
574
584
.. note::
575
585
576
586
Although not required, it is *recommended* that implementations represent this type as an RFC3339 string when de/serializing to/from JSON, respecting the ``TimeUnit`` precision and time zone offset without loss of information. For example ``2025-01-01T00:00:00Z`` represents January 1st 2025 in UTC with second precision, and ``2025-01-01T00:00:00.000000001-07:00`` represents one nanosecond after January 1st 2025 in UTC-07.
0 commit comments