Skip to content

Commit

Permalink
Fix some more capitalization and add a link to Parquet date spec
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed Dec 7, 2024
1 parent e7b7d20 commit 3ffd4d4
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions parquet/src/arrow/schema/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ pub struct ArrowToParquetSchemaConverter<'a> {
schema: &'a Schema,
/// Name of the root schema in Parquet
schema_root: &'a str,
/// Should we Coerce arrow types to compatible Parquet types?
/// Should we coerce Arrow types to compatible Parquet types?
///
/// See docs on [Self::with_coerce_types]`
coerce_types: bool,
Expand All @@ -280,13 +280,13 @@ impl<'a> ArrowToParquetSchemaConverter<'a> {
}
}

/// Should arrow types be coerced into parquet native types (default `false`).
/// Should Arrow types be coerced into Parquet native types (default `false`).
///
/// Setting this option to `true` will result in parquet files that can be
/// read by more readers, but may lose precision for arrow types such as
/// [`DataType::Date64`] which have no direct corresponding Parquet type.
/// Setting this option to `true` will result in Parquet files that can be
/// read by more readers, but may lose precision for Arrow types such as
/// [`DataType::Date64`] which have no direct [corresponding Parquet type].
///
/// By default, this converter does not coerce to native parquet types. Enabling type
/// By default, this converter does not coerce to native Parquet types. Enabling type
/// coercion allows for meaningful representations that do not require
/// downstream readers to consider the embedded Arrow schema, and can allow
/// for greater compatibility with other Parquet implementations. However,
Expand All @@ -300,14 +300,15 @@ impl<'a> ArrowToParquetSchemaConverter<'a> {
/// For example, some Date64 values may be truncated when stored with
/// parquet's native 32 bit date type.
///
/// For [`List`] and [`Map`] types, some
/// Parquet readers expect certain schema elements to have specific names
/// (earlier versions of the spec were somewhat ambiguous on this point).
/// Type coercion will use the names prescribed by the Parquet specification,
/// potentially losing naming metadata from the Arrow schema.
/// For [`List`] and [`Map`] types, some Parquet readers expect certain
/// schema elements to have specific names (earlier versions of the spec
/// were somewhat ambiguous on this point). Type coercion will use the names
/// prescribed by the Parquet specification, potentially losing naming
/// metadata from the Arrow schema.
///
/// [`List`]: https://github.com/apache/parquet-format/blob/master/LogicalTypes.md#lists
/// [`Map`]: https://github.com/apache/parquet-format/blob/master/LogicalTypes.md#maps
/// [corresponding Parquet type]: https://github.com/apache/parquet-format/blob/master/LogicalTypes.md#date
///
pub fn with_coerce_types(mut self, coerce_types: bool) -> Self {
self.coerce_types = coerce_types;
Expand Down

0 comments on commit 3ffd4d4

Please sign in to comment.