assignUser commented on code in PR #12799:
URL: https://github.com/apache/arrow/pull/12799#discussion_r843728947
##########
r/tests/testthat/test-dataset-write.R:
##########
@@ -506,6 +506,47 @@ test_that("Max partitions fails with non-integer values
and less than required p
)
})
+test_that("max_rows_per_group is adjusted if at odds with max_rows_per_file", {
+ skip_if_not_available("parquet")
+ df <- tibble::tibble(
+ int = 1:10,
+ dbl = as.numeric(1:10),
+ lgl = rep(c(TRUE, FALSE, NA, TRUE, FALSE), 2),
+ chr = letters[1:10],
+ )
+ dst_dir <- make_temp_dir()
+
+ # max_rows_per_group unset => pass
+ expect_silent(
+ write_dataset(df, dst_dir, max_rows_per_file = 5)
+ )
+
+ expect_equal(
+ {
+ write_dataset(df, dst_dir, max_rows_per_file = 5)
+ list.files(dst_dir, "part-") %>%
+ length()
+ },
+ 2
+ )
Review Comment:
Agree, I was unsure writing it and you worded my doubts clearly, thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]