wiedld commented on code in PR #13866: URL: https://github.com/apache/datafusion/pull/13866#discussion_r1898604502
########## datafusion/core/src/datasource/file_format/parquet.rs: ########## @@ -2519,6 +2612,42 @@ mod tests { Ok(parquet_sink) } + fn get_written(parquet_sink: Arc<ParquetSink>) -> Result<(Path, FileMetaData)> { + let mut written = parquet_sink.written(); + let written = written.drain(); + assert_eq!( + written.len(), + 1, + "expected a single parquet files to be written, instead found {}", + written.len() + ); + + let (path, file_metadata) = written.take(1).next().unwrap(); + Ok((path, file_metadata)) + } + + fn assert_file_metadata(file_metadata: FileMetaData, expected_kv: Vec<KeyValue>) { Review Comment: The second arg (`expected_kv`) as a ref does indeed avoid the cloning. Thank you. The first arg does not have any cloning currently (see tests), and if we add the ref -- then I would need to clone the `file_metadata.key_value_metadata` in order to sort & compare to the `expected_kv`. -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org