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

Provide Arc-based constructor for parquet::util::cursor::SliceableCursor #368

Closed
crepererum opened this issue May 26, 2021 · 1 comment · Fixed by #369
Closed

Provide Arc-based constructor for parquet::util::cursor::SliceableCursor #368

crepererum opened this issue May 26, 2021 · 1 comment · Fixed by #369
Labels
enhancement Any new improvement worthy of a entry in the changelog

Comments

@crepererum
Copy link
Contributor

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
As a user of arrow-rs, I would like to be able to inspect a parquet file stream that I have just created (e.g. to extract ParquetMetadata) before storing data to disk / cloud / anywhere else. To do so, I construct a SliceableCursor which I then feed into a SerializedFileReader. However, SliceableCursor takes its content as Vec<u8> even though it just uses an Arc<Vec<u8>> internally, so I'm required to copy the parquet data (Vec<u8>) just to inspect it.

Describe the solution you'd like
Allow SliceableCursor to be constructed from an Arc directly.

Describe alternatives you've considered
None.

Additional context
Downstream user is IOx, see here. This issue affects arrow-rs commit 94a82cd5512a9cf9bc341100b862f2ff7f3ab159.

@crepererum crepererum added the enhancement Any new improvement worthy of a entry in the changelog label May 26, 2021
@crepererum
Copy link
Contributor Author

I'm claiming this issue.

crepererum added a commit to crepererum/arrow-rs that referenced this issue May 26, 2021
This is backwards-compatible since we change the argument from `Vec<u8>`
to `impl Into<Arc<Vec<u8>>>` and the following implementations exists in
std:

- `impl<T, U> Into<U> for T where U: From<T>` (reverse direction)
- `impl<T> From<T> for Arc<T>` (create `Arc` from any type)

Furthermore `Arc<Vec<u8>>` can be passed directly now because the following
implementations exists:

- `impl<T> From<T> for T` (identity)

Closes apache#368.
jorgecarleitao pushed a commit that referenced this issue May 26, 2021
This is backwards-compatible since we change the argument from `Vec<u8>`
to `impl Into<Arc<Vec<u8>>>` and the following implementations exists in
std:

- `impl<T, U> Into<U> for T where U: From<T>` (reverse direction)
- `impl<T> From<T> for Arc<T>` (create `Arc` from any type)

Furthermore `Arc<Vec<u8>>` can be passed directly now because the following
implementations exists:

- `impl<T> From<T> for T` (identity)

Closes #368.
alamb pushed a commit that referenced this issue Jun 4, 2021
This is backwards-compatible since we change the argument from `Vec<u8>`
to `impl Into<Arc<Vec<u8>>>` and the following implementations exists in
std:

- `impl<T, U> Into<U> for T where U: From<T>` (reverse direction)
- `impl<T> From<T> for Arc<T>` (create `Arc` from any type)

Furthermore `Arc<Vec<u8>>` can be passed directly now because the following
implementations exists:

- `impl<T> From<T> for T` (identity)

Closes #368.
alamb pushed a commit that referenced this issue Jun 4, 2021
This is backwards-compatible since we change the argument from `Vec<u8>`
to `impl Into<Arc<Vec<u8>>>` and the following implementations exists in
std:

- `impl<T, U> Into<U> for T where U: From<T>` (reverse direction)
- `impl<T> From<T> for Arc<T>` (create `Arc` from any type)

Furthermore `Arc<Vec<u8>>` can be passed directly now because the following
implementations exists:

- `impl<T> From<T> for T` (identity)

Closes #368.
alamb added a commit that referenced this issue Jun 5, 2021
… (#401)

This is backwards-compatible since we change the argument from `Vec<u8>`
to `impl Into<Arc<Vec<u8>>>` and the following implementations exists in
std:

- `impl<T, U> Into<U> for T where U: From<T>` (reverse direction)
- `impl<T> From<T> for Arc<T>` (create `Arc` from any type)

Furthermore `Arc<Vec<u8>>` can be passed directly now because the following
implementations exists:

- `impl<T> From<T> for T` (identity)

Closes #368.

Co-authored-by: Marco Neumann <marco@crepererum.net>
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant