Available on crate feature compute_arithmetics only.
Expand description

Defines the arithmetic kernels for adding a Duration to a Timestamp, Time32, Time64, Date32 and Date64.

For the purposes of Arrow Implementations, adding this value to a Timestamp (“t1”) naively (i.e. simply summing the two number) is acceptable even though in some cases the resulting Timestamp (t2) would not account for leap-seconds during the elapsed time between “t1” and “t2”. Similarly, representing the difference between two Unix timestamp is acceptable, but would yield a value that is possibly a few seconds off from the true elapsed time.

Functions

Adds a duration to a time array (Timestamp, Time and Date). The timeunit enum is used to scale correctly both arrays; adding seconds with seconds, or milliseconds with milliseconds.

Adds a duration to a time array (Timestamp, Time and Date). The timeunit enum is used to scale correctly both arrays; adding seconds with seconds, or milliseconds with milliseconds.

Adds an interval to a DataType::Timestamp.

Subtract a duration to a time array (Timestamp, Time and Date). The timeunit enum is used to scale correctly both arrays; adding seconds with seconds, or milliseconds with milliseconds.

Calculates the difference between two timestamps as DataType::Duration with the same time scale.

Subtract a duration to a time array (Timestamp, Time and Date). The timeunit enum is used to scale correctly both arrays; adding seconds with seconds, or milliseconds with milliseconds.

Calculates the difference between two timestamps returning an array of type Duration. The timeunit enum is used to scale correctly both arrays; subtracting seconds with seconds, or milliseconds with milliseconds.