Antoine Pitrou created ARROW-15688:
--------------------------------------
Summary: [C++] add_checked doesn't error out on duration overflow
Key: ARROW-15688
URL: https://issues.apache.org/jira/browse/ARROW-15688
Project: Apache Arrow
Issue Type: Bug
Components: C++
Affects Versions: 7.0.0
Reporter: Antoine Pitrou
Assignee: Rok Mihevc
Example in Python:
{code:python}
>>> pa.compute.add_checked(pa.array([2**62], type=pa.duration('ms')),
>>> pa.array([2**62], type=pa.duration('ms')))
<pyarrow.lib.DurationArray object at 0x7f1539465b80>
[
-9223372036854775808
]
{code}
The same computation with plain integers correctly raises an error:
{code:python}
>>> pa.compute.add_checked(pa.array([2**62], type=pa.int64()),
>>> pa.array([2**62], type=pa.int64()))
Traceback (most recent call last):
[...]
ArrowInvalid: overflow
{code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)