You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: update examples in ArrowReaderOptions to use in-memory buffers (#9163)
# Which issue does this PR close?
Closes#9161
# Rationale for this change
This PR applies the feedback from #9116 to make the parquet reader
documentation examples more concise and easier to follow.
# What changes are included in this PR?
Updated 3 documentation examples in
`parquet/src/arrow/arrow_reader/mod.rs`:
1. **`with_schema` example 1** - Schema mapping with timestamp
2. **`with_schema` example 2** - Dictionary encoding preservation
3. **`with_virtual_columns` example** - Virtual columns for row numbers
Changes in each example:
- Replaced `tempfile::tempfile()` with `Vec::new()` for in-memory buffer
- Added `use bytes::Bytes;` import
- Changed `ArrowWriter::try_new(file.try_clone()?, ...)` to
`ArrowWriter::try_new(&mut file, ...)`
- Added `let file = Bytes::from(file);` to convert buffer for reading
- Added `#` prefixes to hide setup/imports in rendered docs
The async example in `async_reader/mod.rs` was intentionally left
unchanged since it demonstrates `tokio::fs::File` usage.
# Are there any user-facing changes?
No functional changes, only documentation improvements to make examples
smaller and cleaner in rendered docs.
0 commit comments