etseidl commented on code in PR #6313:
URL: https://github.com/apache/arrow-rs/pull/6313#discussion_r1779132562
##########
parquet/src/file/properties.rs:
##########
@@ -279,6 +282,13 @@ impl WriterProperties {
self.statistics_truncate_length
}
+ /// Returns `coerce_types` boolean
+ ///
+ /// `true` if type coercion enabled.
Review Comment:
Might want to add some words about what type coercion does.
##########
parquet/src/arrow/array_reader/primitive_array.rs:
##########
@@ -208,10 +208,10 @@ where
// As there is not always a 1:1 mapping between Arrow and Parquet,
there
// are datatypes which we must convert explicitly.
// These are:
- // - date64: we should cast int32 to date32, then date32 to date64.
- // - decimal: cast in32 to decimal, int64 to decimal
+ // - date64: cast int32 to date32, then date32 to date64.
+ // - decimal: cast int32 to decimal, int64 to decimal
let array = match target_type {
- ArrowType::Date64 => {
+ ArrowType::Date64 if *(array.data_type()) == ArrowType::Int32 => {
Review Comment:
❤️
##########
parquet/src/arrow/schema/mod.rs:
##########
@@ -1577,7 +1589,7 @@ mod tests {
false,
)];
let arrow_schema = Schema::new(arrow_fields);
- let converted_arrow_schema = arrow_to_parquet_schema(&arrow_schema);
+ let converted_arrow_schema = arrow_to_parquet_schema(&arrow_schema,
true);
Review Comment:
Any reason this is set to `true`?
##########
parquet/src/arrow/schema/mod.rs:
##########
@@ -1851,7 +1863,7 @@ mod tests {
// don't pass metadata so field ids are read from Parquet and not from
serialized Arrow schema
let arrow_schema =
crate::arrow::parquet_to_arrow_schema(&schema_descriptor, None)?;
- let parq_schema_descr =
crate::arrow::arrow_to_parquet_schema(&arrow_schema)?;
+ let parq_schema_descr =
crate::arrow::arrow_to_parquet_schema(&arrow_schema, true)?;
Review Comment:
same comment
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]