Describe the bug, including details regarding any error messages, version, and platform.
The current asof join implementation does not check the null bitmap before indexing into the time column's value buffer. This creates matches that should not be possible. For example,
importpyarrowaspalhs=pa.table({
"time": pa.array([None], type=pa.int64())
})
rhs=pa.table({
"time": [0],
"data": [True],
})
lhs.join_asof(rhs, "time", [], 0)produces
which implies that null equals 0. By manipulating the value buffer, we can get null to "equal" any integer:
lhs=pa.table({
"time": pa.Array.from_buffers(
pa.int32(),
1,
[pa.py_buffer(b"\x00"), pa.py_buffer(b"\xf0\x00\x00\x00")],
),
})
rhs=pa.table({
"time": pa.array([0xf0], type=pa.int32()),
"payload": ["abc"],
})
# lhs: rhs:# time time payload# 0 null 0 240 abcresult=lhs.join_asof(rhs, "time", [], 0)
# result:# time payload# 0 null abc -> non-null payload means null matched 240This could be fixed by adding a null check in the GetTime function in time_series_util.cc, but it's not clear to me what the correct behavior should be.
Component(s)
C++
Describe the bug, including details regarding any error messages, version, and platform.
The current asof join implementation does not check the null bitmap before indexing into the time column's value buffer. This creates matches that should not be possible. For example,
produces
which implies that null equals 0. By manipulating the value buffer, we can get null to "equal" any integer:
This could be fixed by adding a null check in the
GetTimefunction intime_series_util.cc, but it's not clear to me what the correct behavior should be.Component(s)
C++