Skip to content

GH-55685: [C++][Parquet] Fix zero-length append in DeltaLengthByteArrayEncoder - #55729

Open
aditya07-ui wants to merge 1 commit into
apache:mainfrom
aditya07-ui:fix/parquet-zero-length-unsafe-append
Open

aditya07-ui wants to merge 1 commit into
apache:mainfrom
aditya07-ui:fix/parquet-zero-length-unsafe-append

Conversation

@aditya07-ui

Copy link
Copy Markdown

Summary

Skip UnsafeAppend when the byte array length is zero.

Avoid passing a potentially null pointer to the append operation for zero-length values.

Testing

Not tested locally yet.

@aditya07-ui aditya07-ui changed the title Fix zero-length append in DeltaLengthByteArrayEncoder GH-55685: [C++][Parquet] Fix zero-length append in DeltaLengthByteArrayEncoder Nov 22, 2026
@aditya07-ui aditya07-ui reopened this Nov 23, 2026
@aditya07-ui aditya07-ui reopened this Nov 23, 2026
@Sumdiboii

Copy link
Copy Markdown
Contributor

Not a maintainer, just a bystander who looked into this...the len > 0 check makes total sense to avoid passing nullptr to memcpy on empty ByteArrays.

Don't you think it'd be worth adding a quick unit test in encoding_test.cc for ByteArray(0, nullptr)?

Also, I saw #55685 mentions the MemoryPool* constructor bug (and PutSpaced might need this same guard too), and you might want to fill out the standard Apache Arrow PR template description so reviewers have all the context they'd need. Otherwise looks good to me...let's wait for a maintainer review though.

@pitrou

pitrou commented Nov 23, 2026

Copy link
Copy Markdown
Member

Don't you think it'd be worth adding a quick unit test in encoding_test.cc for ByteArray(0, nullptr)?

That's an interesting suggestion, especially if it's made to work on all encodings that support BYTE_ARRAY.

@pitrou

pitrou commented Nov 23, 2026

Copy link
Copy Markdown
Member

That said, there is already #55686 open that fixes the same issue and looks more complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants