Skip to content

Commit a6c8dbe

Browse files
alambcomphead
andauthored
Apply suggestions from code review
Co-authored-by: Oleks V <comphead@users.noreply.github.com>
1 parent cc8de02 commit a6c8dbe

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

datafusion/datasource/src/memory.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -426,15 +426,7 @@ impl DataSource for MemorySourceConfig {
426426
}
427427
DisplayFormatType::TreeRender => {
428428
let total_rows = self.partitions.iter().map(|b| b.len()).sum::<usize>();
429-
let total_bytes = self
430-
.partitions
431-
.iter()
432-
.map(|b| {
433-
b.iter()
434-
.map(|batch| batch.get_array_memory_size())
435-
.sum::<usize>()
436-
})
437-
.sum::<usize>();
429+
let total_bytes: usize = self.partitions.iter().flatten().map(|batch| batch.get_array_memory_size()).sum();
438430
writeln!(f, "format=memory")?;
439431
writeln!(f, "rows={total_rows}")?;
440432
writeln!(f, "bytes={total_bytes}")?;

0 commit comments

Comments
 (0)