MCPcopy Create free account
hub / github.com/apache/datafusion / write_output

Method write_output

datafusion-cli/src/print_options.rs:185–218  ·  view source on GitHub ↗
(
        &self,
        writer: &mut W,
        formatted_exec_details: &str,
    )

Source from the content-addressed store, hash-verified

183 }
184
185 fn write_output<W: io::Write>(
186 &self,
187 writer: &mut W,
188 formatted_exec_details: &str,
189 ) -> Result<()> {
190 if !self.quiet {
191 writeln!(writer, "{formatted_exec_details}")?;
192
193 let instrument_mode = self.instrumented_registry.instrument_mode();
194 if instrument_mode != InstrumentedObjectStoreMode::Disabled {
195 writeln!(writer, "{OBJECT_STORE_PROFILING_HEADER}")?;
196 for store in self.instrumented_registry.stores() {
197 let requests = store.take_requests();
198
199 if !requests.is_empty() {
200 writeln!(writer, "{store}")?;
201 if instrument_mode == InstrumentedObjectStoreMode::Trace {
202 for req in requests.iter() {
203 writeln!(writer, "{req}")?;
204 }
205 // Add an extra blank line to help visually organize the output
206 writeln!(writer)?;
207 }
208
209 writeln!(writer, "Summaries:")?;
210 let summaries = RequestSummaries::new(&requests);
211 writeln!(writer, "{summaries}")?;
212 }
213 }
214 }
215 }
216
217 Ok(())
218 }
219}
220
221#[cfg(test)]

Callers 3

print_batchesMethod · 0.80
print_streamMethod · 0.80
write_outputFunction · 0.80

Calls 6

newFunction · 0.85
instrument_modeMethod · 0.80
storesMethod · 0.80
take_requestsMethod · 0.80
is_emptyMethod · 0.45
iterMethod · 0.45

Tested by 1

write_outputFunction · 0.64