apache / apache/arrow-nanoarrow
ArrowArrayAppendBytes has a narrowing cast when appending views with >INT32_MAX bytes
- Dominant language
- C
- Stars
- 249
- Forks
- 68
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 11
Description
Found by Codex when reviewing https://github.com/apache/arrow-nanoarrow/pull/930
The offending narrowing cast is:
```c
if (private_data->storage_type == NANOARROW_TYPE_STRING_VIEW ||
private_data->storage_type == NANOARROW_TYPE_BINARY_VIEW) {
struct ArrowBuffer* data_buffer = ArrowArrayBuffer(array, 1);
union ArrowBinaryView bvt;
bvt.inlined.size = (int32_t)value.size_bytes;
if (value.size_bytes <= NANOARROW_BINARY_VIEW_INLINE_SIZE) {
memcpy(bvt.inlined.data, value.data.as_char, value.size_bytes);
memset(bvt.inlined.data + bvt.inlined.size, 0,
NANOARROW_BINARY_VIEW_INLINE_SIZE - bvt.inlined.size);
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the ArrowArrayAppendBytes entry point and inspect the string-view and binary-view handling shown in the issue. Trace how sizes are represented for values larger than INT32_MAX, then verify that appending such a view no longer performs a narrowing conversion while existing inline-view behavior remains correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100