From 004a4580165cc8b506f29bb03056886cfee10143 Mon Sep 17 00:00:00 2001 From: zhuliquan Date: Sun, 21 Jul 2024 01:16:54 +0800 Subject: [PATCH] test: get file size by func metadata --- datafusion/core/src/datasource/file_format/csv.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/datafusion/core/src/datasource/file_format/csv.rs b/datafusion/core/src/datasource/file_format/csv.rs index 5daa8447551b1..b65cd3b1b62fa 100644 --- a/datafusion/core/src/datasource/file_format/csv.rs +++ b/datafusion/core/src/datasource/file_format/csv.rs @@ -1251,11 +1251,8 @@ mod tests { "+-----------------------+", "| 50 |", "+-----------------------+"]; - let file_size = if cfg!(target_os = "windows") { - 30 // new line on Win is '\r\n' - } else { - 20 - }; + + let file_size = std::fs::metadata("tests/data/one_col.csv")?.len() as usize; // A 20-Byte file at most get partitioned into 20 chunks let expected_partitions = if n_partitions <= file_size { n_partitions