Skip to content

Commit

Permalink
feat(rust): Allow specification of chunk_size on `LazyCsvReader.rea…
Browse files Browse the repository at this point in the history
…d_options` (#19819)
  • Loading branch information
engylemure authored Nov 16, 2024
1 parent 9ceedde commit 97b92a5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crates/polars-lazy/src/scan/csv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@ impl LazyCsvReader {
self
}

/// Sets the chunk size used by the parser. This influences performance.
/// This can be used as a way to reduce memory usage during the parsing at the cost of performance.
pub fn with_chunk_size(mut self, chunk_size: usize) -> Self {
self.read_options.chunk_size = chunk_size;
self
}

/// Set the CSV file's column separator as a byte character
#[must_use]
pub fn with_separator(self, separator: u8) -> Self {
Expand Down

0 comments on commit 97b92a5

Please sign in to comment.