Print when the result batches contain no rows
(
&self,
writer: &mut W,
schema: SchemaRef,
format_options: &FormatOptions,
)
| 192 | |
| 193 | /// Print when the result batches contain no rows |
| 194 | fn print_empty<W: std::io::Write>( |
| 195 | &self, |
| 196 | writer: &mut W, |
| 197 | schema: SchemaRef, |
| 198 | format_options: &FormatOptions, |
| 199 | ) -> Result<()> { |
| 200 | match self { |
| 201 | // Print column headers for Table format |
| 202 | Self::Table if !schema.fields().is_empty() => { |
| 203 | let format_options: arrow::util::display::FormatOptions = |
| 204 | format_options.try_into()?; |
| 205 | |
| 206 | let empty_batch = RecordBatch::new_empty(schema); |
| 207 | let formatted = |
| 208 | pretty_format_batches_with_options(&[empty_batch], &format_options)?; |
| 209 | writeln!(writer, "{formatted}")?; |
| 210 | } |
| 211 | _ => {} |
| 212 | } |
| 213 | Ok(()) |
| 214 | } |
| 215 | } |
| 216 | |
| 217 | #[cfg(test)] |
no test coverage detected