Skip to content

Commit

Permalink
ARROW-13977: [Format] clarify leap seconds for interval type
Browse files Browse the repository at this point in the history
Like other time units, we don't account for leap seconds for interval types. For MONTH_DAY_NANO, we do account for leap days.

Closes apache#11138 from houqp/qp_interval

Authored-by: Qingping Hou <dave2008713@gmail.com>
Signed-off-by: Qingping Hou <dave2008713@gmail.com>
  • Loading branch information
houqp authored and ViniciusSouzaRoque committed Oct 20, 2021
1 parent c509e93 commit e5e381c
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions format/Schema.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -357,18 +357,19 @@ enum IntervalUnit: short { YEAR_MONTH, DAY_TIME, MONTH_DAY_NANO}
// days can differ in length during day light savings time transitions).
// All integers in the types below are stored in the endianness indicated
// by the schema.
//
// YEAR_MONTH - Indicates the number of elapsed whole months, stored as
// 4-byte signed integers.
// DAY_TIME - Indicates the number of elapsed days and milliseconds,
// stored as 2 contiguous 32-bit integers (8-bytes in total). Support
// DAY_TIME - Indicates the number of elapsed days and milliseconds (no leap seconds),
// stored as 2 contiguous 32-bit signed integers (8-bytes in total). Support
// of this IntervalUnit is not required for full arrow compatibility.
// MONTH_DAY_NANO - A triple of the number of elapsed months, days, and nanoseconds.
// The values are stored contiguously in 16 byte blocks. Months and
// days are encoded as 32 bit integers and nanoseconds is encoded as a
// 64 bit integer. All integers are signed. Each field is independent
// (e.g. there is no constraint that nanoseconds have the same sign
// as days or that the quantity of nanoseconds represents less
// than a day's worth of time).
// The values are stored contiguously in 16-byte blocks. Months and days are
// encoded as 32-bit signed integers and nanoseconds is encoded as a 64-bit
// signed integer. Nanoseconds does not allow for leap seconds. Each field is
// independent (e.g. there is no constraint that nanoseconds have the same
// sign as days or that the quantity of nanoseconds represents less than a
// day's worth of time).
table Interval {
unit: IntervalUnit;
}
Expand Down

0 comments on commit e5e381c

Please sign in to comment.