Skip to content

Commit

Permalink
fix: file-size-threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
pacman82 committed Nov 1, 2023
1 parent 927ebf3 commit d5c79bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 3.0.0 (next)

* Zero sized columns are now treated as an error. Before `odbc2parquet` issued a warning and ignored them.
* Fix: `--file-size-threshold` had an issue with not resetting the current file size after starting a new file. This caused only the first file to have the desired size. All subsequent files would contain only one row group each.

## 2.0.4

Expand Down
2 changes: 2 additions & 0 deletions src/query/parquet_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ impl ParquetWriter {
.should_start_new_file(num_batch, self.current_file_size)
{
self.num_file += 1;
// Reset current file size, so the next file will not be considered too large immediatly
self.current_file_size = ByteSize::b(0);
let file: Box<dyn Write + Send> = Box::new(create_output_file(
self.path.as_deref().unwrap(),
Some((self.num_file, self.suffix_length)),
Expand Down

0 comments on commit d5c79bc

Please sign in to comment.