This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new 5f0ab3100f test: get file size by func metadata (#11575)
5f0ab3100f is described below
commit 5f0ab3100f7aec71891acd7ecd3415e142d4ea78
Author: zhuliquan <[email protected]>
AuthorDate: Wed Jul 24 01:36:42 2024 +0800
test: get file size by func metadata (#11575)
---
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 185f50883b..958d2694aa 100644
--- a/datafusion/core/src/datasource/file_format/csv.rs
+++ b/datafusion/core/src/datasource/file_format/csv.rs
@@ -1301,11 +1301,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
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]