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

parquet: convert Bytes to ByteArray directly #3719

Closed
dopelsunce opened this issue Feb 14, 2023 · 1 comment · Fixed by #3720
Closed

parquet: convert Bytes to ByteArray directly #3719

dopelsunce opened this issue Feb 14, 2023 · 1 comment · Fixed by #3720
Labels
enhancement Any new improvement worthy of a entry in the changelog parquet Changes to the parquet crate

Comments

@dopelsunce
Copy link

dopelsunce commented Feb 14, 2023

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

I'm using SerializedFileWriter to write byte arrays to parquet files in my project which implements a C# binding to the parquet crate. I find it difficult to construct ByteArray from raw bytes received across FFI. A conversion path from bytes::Bytes to ByteArray would be really useful.

Right now, ByteArray only supports conversion from Vec<u8> and &str.

Describe the solution you'd like

Implement From<Bytes> for ByteArray,

Describe alternatives you've considered

For now, I'm using util::memory::ByteBufferPtr hidden behind the experimental feature flag to achieve this goal.

Additional context

I find ByteArray is a wrapper around Bytes. Short term, we can add trait From<Bytes> for ByteArray.

In comments above ByteBufferPtr,

TODO: Remove and replace with [bytes::Bytes]".

I agree ideally we should remove the internal struct ByteBufferPtr.

@dopelsunce dopelsunce added the enhancement Any new improvement worthy of a entry in the changelog label Feb 14, 2023
@tustvold
Copy link
Contributor

label_issue.py automatically added labels {'parquet'} from #3720

@tustvold tustvold added the parquet Changes to the parquet crate label Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Any new improvement worthy of a entry in the changelog parquet Changes to the parquet crate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants