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

Method print_batches

datafusion-cli/src/print_options.rs:110–141  ·  view source on GitHub ↗

Print the batches to stdout using the specified format

(
        &self,
        schema: SchemaRef,
        batches: &[RecordBatch],
        query_start_time: Instant,
        row_count: usize,
        format_options: &FormatOptions,
    )

Source from the content-addressed store, hash-verified

108impl PrintOptions {
109 /// Print the batches to stdout using the specified format
110 pub fn print_batches(
111 &self,
112 schema: SchemaRef,
113 batches: &[RecordBatch],
114 query_start_time: Instant,
115 row_count: usize,
116 format_options: &FormatOptions,
117 ) -> Result<()> {
118 let stdout = io::stdout();
119 let mut writer = stdout.lock();
120
121 self.format.print_batches(
122 &mut writer,
123 schema,
124 batches,
125 self.maxrows,
126 true,
127 format_options,
128 )?;
129
130 let formatted_exec_details = get_execution_details_formatted(
131 row_count,
132 if self.format == PrintFormat::Table {
133 self.maxrows
134 } else {
135 MaxRows::Unlimited
136 },
137 query_start_time,
138 );
139
140 self.write_output(&mut writer, &formatted_exec_details)
141 }
142
143 /// Print the stream to stdout using the specified format
144 pub async fn print_stream(

Callers 1

print_streamMethod · 0.45

Calls 2

write_outputMethod · 0.80

Tested by

no test coverage detected