devinjdangelo commented on code in PR #9737:
URL: https://github.com/apache/arrow-datafusion/pull/9737#discussion_r1536286778
##########
datafusion/core/src/dataframe/parquet.rs:
##########
@@ -166,4 +166,47 @@ mod tests {
Ok(())
}
+
+ #[tokio::test]
+ async fn write_parquet_with_small_rg_size() -> Result<()> {
+ let mut test_df = test_util::test_table().await?;
+ // make the test data larger so there are multiple batches
+ for _ in 0..7 {
+ test_df = test_df.clone().union(test_df)?;
+ }
+ let output_path = "file://local/test.parquet";
+
+ for rg_size in (1..7).step_by(5) {
+ let df = test_df.clone();
+ let tmp_dir = TempDir::new()?;
+ let local = Arc::new(LocalFileSystem::new_with_prefix(&tmp_dir)?);
+ let local_url = Url::parse("file://local").unwrap();
+ let ctx = &test_df.session_state;
+ ctx.runtime_env().register_object_store(&local_url, local);
+ let mut options = TableParquetOptions::default();
+ options.global.max_row_group_size = rg_size;
+ options.global.allow_single_file_parallelism = true;
+ df.write_parquet(
+ output_path,
+ DataFrameWriteOptions::new().with_single_file_output(true),
+ Some(options),
+ )
+ .await?;
+
+ // Check that file actually used the correct rg size
+ let file =
std::fs::File::open(tmp_dir.into_path().join("test.parquet"))?;
Review Comment:
I fixed this in the new test and a preexisting one.
--
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]