Skip to content

[C++] Filter kernel for MonthDayNanoInterval array returning garbage values #39740

@jorisvandenbossche

Description

@jorisvandenbossche

Example with latest pyarrow:

>>> import pyarrow as pa
>>> pa.__version__
Out[30]: '15.0.0.dev436+gac50918a6.d20240117'
>>> import pyarrow.compute as pc

>>> arr = pa.array([pa.MonthDayNano((1, 1, 1)), pa.MonthDayNano((2, 2, 2))])
>>> arr
<pyarrow.lib.MonthDayNanoIntervalArray object at 0x7f8e89147220>
[
  1M1d1ns,
  2M2d2ns
]
>>> pc.filter(arr, pa.array([True, False]))
Out[36]: 
<pyarrow.lib.MonthDayNanoIntervalArray object at 0x7f8e89e24580>
[
  3M0d0ns    # <-- this value didn't even exist in the original array
]

>>> arr = pa.array([pa.MonthDayNano((1, 1, 1)), None])
>>> arr
<pyarrow.lib.MonthDayNanoIntervalArray object at 0x7f8e89e24820>
[
  1M1d1ns,
  null
]
>>> pc.filter(arr, pa.array([True, False]))
<pyarrow.lib.MonthDayNanoIntervalArray object at 0x7f8e88e4eda0>
[
  null   # <-- this should have selected the first element of the array, but returning null instead
]

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions