comphead commented on code in PR #15029:
URL: https://github.com/apache/datafusion/pull/15029#discussion_r1982300094
##########
datafusion/datasource/src/memory.rs:
##########
@@ -425,25 +425,20 @@ impl DataSource for MemorySourceConfig {
}
}
DisplayFormatType::TreeRender => {
- let partition_sizes: Vec<_> =
- self.partitions.iter().map(|b| b.len()).collect();
- writeln!(f, "partition_sizes={:?}", partition_sizes)?;
-
- if let Some(output_ordering) = self.sort_information.first() {
- writeln!(f, "output_ordering={}", output_ordering)?;
- }
-
- let eq_properties = self.eq_properties();
- let constraints = eq_properties.constraints();
- if !constraints.is_empty() {
- writeln!(f, "constraints={}", constraints)?;
- }
-
- if let Some(limit) = self.fetch {
- writeln!(f, "fetch={}", limit)?;
- }
-
- write!(f, "partitions={}", partition_sizes.len())
+ let total_rows = self.partitions.iter().map(|b|
b.len()).sum::<usize>();
+ let total_bytes = self
+ .partitions
+ .iter()
+ .map(|b| {
+ b.iter()
+ .map(|batch| batch.get_array_memory_size())
+ .sum::<usize>()
+ })
+ .sum::<usize>();
+ writeln!(f, "format=memory")?;
Review Comment:
Looks like this part was not covered by tests, should we cover it in
followup PR?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]