Skip to content

Conversation

@alamb
Copy link
Contributor

@alamb alamb commented Oct 26, 2020

Rationale

7155cd5 / #8300 Reworked how the parquet reader traits were implemented to be interms of a ChunkReader trait (for the better, in my opinion).

That commit includes two helper classes, SliceableCursor and FileSource, which implement ChunkReader for a Cursor like thing and Files, respectively.

My project instantiates a SerializedFileWriter from the parquet crate with structs that wrap File and Cursor and thus I would like to re-use the logic in SliceableCursor and FileSource without having to copy/paste them.

Changes

  1. Publically export SliceableCursor and FileSource
  2. Implement Seek for SliceableCursor
  3. Implement Debug for both SliceableCursor and FileSource

@github-actions
Copy link

Thanks for opening a pull request!

Could you open an issue for this pull request on JIRA?
https://issues.apache.org/jira/browse/ARROW

Then could you also rename pull request title in the following format?

ARROW-${JIRA_ID}: [${COMPONENT}] ${SUMMARY}

See also:

@alamb alamb force-pushed the alamb/ARROW-10396-expose-helpers branch from 67db2cb to 15d5fff Compare October 27, 2020 10:46
@alamb alamb changed the title ARROW-10396: [Rust][Parquet] Publically export SliceableCursor and FileSource (DRAFT) ARROW-10396: [Rust] [Parquet] Publically export SliceableCursor and FileSource (DRAFT) Oct 27, 2020
inner: Rc<Vec<u8>>,
}

impl fmt::Debug for SliceableCursor {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used this formulation rather than [#derive(Debug)] to avoid getting the buffer contents dumped which can be lots of data to sort through.

@alamb alamb changed the title ARROW-10396: [Rust] [Parquet] Publically export SliceableCursor and FileSource (DRAFT) ARROW-10396: [Rust] [Parquet] Publically export SliceableCursor and FileSource Oct 27, 2020
@alamb alamb marked this pull request as ready for review October 27, 2020 10:55
@alamb
Copy link
Contributor Author

alamb commented Oct 27, 2020

fyi @rdettai / @sunchao

Copy link
Member

@andygrove andygrove left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jorgecarleitao jorgecarleitao changed the title ARROW-10396: [Rust] [Parquet] Publically export SliceableCursor and FileSource ARROW-10396: [Rust] [Parquet] Publically export SliceableCursor and FileSource Oct 31, 2020
@alamb alamb deleted the alamb/ARROW-10396-expose-helpers branch November 1, 2020 14:26
@alamb
Copy link
Contributor Author

alamb commented Nov 1, 2020

🎉

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.

2 participants