Skip to content

Commit b41b4fb

Browse files
committed
Add document
1 parent 7e45eb6 commit b41b4fb

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

datafusion/core/src/datasource/file_format/parquet.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ impl FileFormat for ParquetFormat {
385385
};
386386

387387
let schema = if self.force_view_types() {
388-
Arc::new(transform_schema_to_view(&schema))
388+
Arc::new(transform_schema_to_view(schema.as_ref()))
389389
} else {
390390
schema
391391
};

datafusion/datasource/src/file_format.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ pub trait FileFormat: Send + Sync + fmt::Debug {
7373
objects: &[ObjectMeta],
7474
) -> Result<SchemaRef>;
7575

76-
/// Transform the schema of the provided object. The cost and accuracy of the
76+
/// Transform the schema of the provided object. For example for parquet files:
77+
/// 1. Transform a schema so that any binary types are strings
78+
/// 2. Transform a schema to use view types for Utf8 and Binary
79+
/// Other file formats may have other transformations, but currently only for parquet
7780
async fn transform_schema(&self, schema: SchemaRef) -> Result<SchemaRef>;
7881

7982
/// Infer the statistics for the provided object. The cost and accuracy of the

0 commit comments

Comments
 (0)