Skip to content

Commit

Permalink
Try fix file size
Browse files Browse the repository at this point in the history
  • Loading branch information
2010YOUY01 committed Jun 29, 2023
1 parent 9f6481d commit 4176f87
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ jobs:
shell: bash
run: |
export PATH=$PATH:$HOME/d/protoc/bin
cargo test --lib --tests --bins --features avro,json,dictionary_expressions -- --nocapture
cd datafusion-cli
cargo test --lib --tests --bins --all-features
cargo test csv_parallel_one_col -- --nocapture
env:
# do not produce debug symbols to keep memory usage down
RUSTFLAGS: "-C debuginfo=0"
10 changes: 7 additions & 3 deletions datafusion/core/src/datasource/file_format/csv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,7 @@ mod tests {
/// 5\n
/// 5\n
/// (...10 rows total)
#[rstest(n_partitions, case(1), case(2), case(3), case(7), case(10), case(32))]
#[rstest(n_partitions, case(1), case(2), case(3), case(5), case(10), case(32))]
#[tokio::test]
async fn test_csv_parallel_one_col(n_partitions: usize) -> Result<()> {
let config = SessionConfig::new()
Expand Down Expand Up @@ -1241,8 +1241,12 @@ mod tests {
"| 50 |",
"+-----------------------+",
];
// File is `file_size` bytes (20 Bytes here), at most get repartitioned into 20 partitions
let file_size = 20;
// A 20-byte file at most get repartitioned into 20 chunks
let file_size = if cfg!(target_os = "windows") {
30 // newline on Win is '\r\n'
} else {
20
};
let expected_partitions = if n_partitions <= file_size {
n_partitions
} else {
Expand Down

0 comments on commit 4176f87

Please sign in to comment.