jonkeane commented on a change in pull request #11613:
URL: https://github.com/apache/arrow/pull/11613#discussion_r746613254



##########
File path: r/R/parquet.R
##########
@@ -196,7 +196,27 @@ write_parquet <- function(x,
       allow_truncated_timestamps = allow_truncated_timestamps
     )
   )
-  writer$WriteTable(x, chunk_size = chunk_size %||% x$num_rows)
+
+  # determine an approximate chunk size
+  if (is.null(chunk_size)) {
+    num_cells <- x$num_rows * x$num_columns
+    target_cells_per_group <- getOption("arrow.parquet_cells_per_group", 2.5e8)
+
+    if (num_cells < target_cells_per_group) {
+      # If the total number of cells is less than the 2.5 million, we want one 
group
+      num_chunks <- 1
+    } else {
+      # no more than 2.5 million cells (rows * cols) per group

Review comment:
       ```suggestion
         # no more than the default 250 million cells (rows * cols) per group
   ```




-- 
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]


Reply via email to