|
17 | 17 |
|
18 | 18 | //! ParquetSource implementation for reading parquet files
|
19 | 19 | use std::any::Any;
|
20 |
| -use std::fmt::Debug; |
21 |
| -use std::fmt::Formatter; |
| 20 | +use std::fmt::{self, Debug, Formatter}; |
22 | 21 | use std::sync::Arc;
|
23 | 22 |
|
24 | 23 | use crate::opener::build_pruning_predicates;
|
@@ -269,7 +268,7 @@ use object_store::ObjectStore;
|
269 | 268 | /// [`RecordBatch`]: arrow::record_batch::RecordBatch
|
270 | 269 | /// [`SchemaAdapter`]: datafusion_datasource::schema_adapter::SchemaAdapter
|
271 | 270 | /// [`ParquetMetadata`]: parquet::file::metadata::ParquetMetaData
|
272 |
| -#[derive(Debug, Clone)] |
| 271 | +#[derive(Clone)] |
273 | 272 | pub struct ParquetSource {
|
274 | 273 | /// Options for reading Parquet files
|
275 | 274 | pub(crate) table_parquet_options: TableParquetOptions,
|
@@ -447,7 +446,7 @@ impl ParquetSource {
|
447 | 446 | // If the FileScanConfig.file_source() has a schema adapter factory, apply it
|
448 | 447 | if let Some(factory) = &self.schema_adapter_factory() {
|
449 | 448 | file_source.with_schema_adapter_factory(
|
450 |
| - Arc::<dyn SchemaAdapterFactory>::clone(&factory), |
| 449 | + Arc::<dyn SchemaAdapterFactory>::clone(factory), |
451 | 450 | )
|
452 | 451 | } else {
|
453 | 452 | Ok(file_source)
|
@@ -632,7 +631,7 @@ impl FileSource for ParquetSource {
|
632 | 631 | "parquet"
|
633 | 632 | }
|
634 | 633 |
|
635 |
| - fn fmt_extra(&self, t: DisplayFormatType, f: &mut Formatter) -> std::fmt::Result { |
| 634 | + fn fmt_extra(&self, t: DisplayFormatType, f: &mut Formatter) -> fmt::Result { |
636 | 635 | match t {
|
637 | 636 | DisplayFormatType::Default | DisplayFormatType::Verbose => {
|
638 | 637 | let predicate_string = self
|
@@ -767,3 +766,12 @@ impl FileSource for ParquetSource {
|
767 | 766 | self.schema_adapter_factory.clone()
|
768 | 767 | }
|
769 | 768 | }
|
| 769 | + |
| 770 | +impl Debug for ParquetSource { |
| 771 | + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { |
| 772 | + write!(f, "{} {{ ", self.file_type())?; |
| 773 | + write!(f, "statistics={:?}, ", self.file_source_statistics())?; |
| 774 | + write!(f, "config={:?} ", self.config())?; |
| 775 | + write!(f, " }}") |
| 776 | + } |
| 777 | +} |
0 commit comments