Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix not being able to encode byte slice #366

Closed
wants to merge 2 commits into from

Conversation

lbjarre
Copy link

@lbjarre lbjarre commented Mar 9, 2021

This patch introduces a check when marshalling a interface type based
on the INT32 parquet type by defensively checking if it's a uint8, and
therefore handling the byte case without panicing.

Added a simple test case to cover the intended usecase.

Handles some of the issues raised in #321, though more convenient encoding of a byte slice as a BYTE_ARRAY might be better.

@lbjarre lbjarre force-pushed the fix/byte-slice-repeated branch from f7b84f6 to 29d352a Compare March 10, 2021 07:05
@lbjarre
Copy link
Author

lbjarre commented Mar 10, 2021

Sorry, managed to push all of the formatting changes but not the actual code change. Force pushed with the actual update.

This patch introduces a check when marshalling a interface type based on
the INT32 parquet type by defensively checking if it's a uint8, and
therefore handling the byte case without panicing.

Added a simple test case to cover the intended usecase.
@lbjarre lbjarre force-pushed the fix/byte-slice-repeated branch from 29d352a to ed94266 Compare March 10, 2021 09:20
@xitongsys
Copy link
Owner

this change may not be a general way to support byte array. I'm considering to support it.
Anyway, thanks !

@xitongsys xitongsys closed this Mar 31, 2021
@ArunanSivanathan
Copy link

I faced same issue recently #582. But this implementation is going to have each byte as int32 correct? Don't you think this is an in efficient way to store a single byte in 4 byte integer format?

Please correct me if I'm wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants