nevi-me commented on a change in pull request #9612:
URL: https://github.com/apache/arrow/pull/9612#discussion_r593995672
##########
File path: rust/parquet/src/arrow/schema.rs
##########
@@ -364,32 +385,51 @@ fn arrow_to_parquet_type(field: &Field) -> Result<Type> {
DataType::Float64 => Type::primitive_type_builder(name,
PhysicalType::DOUBLE)
.with_repetition(repetition)
.build(),
- DataType::Timestamp(time_unit, _) => {
+ DataType::Timestamp(time_unit, zone) => {
Type::primitive_type_builder(name, PhysicalType::INT64)
- .with_converted_type(match time_unit {
- TimeUnit::Second => ConvertedType::TIMESTAMP_MILLIS,
- TimeUnit::Millisecond => ConvertedType::TIMESTAMP_MILLIS,
- TimeUnit::Microsecond => ConvertedType::TIMESTAMP_MICROS,
- TimeUnit::Nanosecond => ConvertedType::TIMESTAMP_MICROS,
- })
+ .with_logical_type(Some(LogicalType::TIMESTAMP(TimestampType {
+ is_adjusted_to_u_t_c: matches!(zone, Some(z) if z.as_str()
== "UTC"),
Review comment:
Yeah, I think that my logic is faulty. Reading
https://github.com/apache/parquet-format/blob/master/LogicalTypes.md#instant-semantics-timestamps-normalized-to-utc
again, I now see that it says that `is_adjusted_to_u_t_c = true` is if we
actually adjust the timezone.
So, I think it's safer to use `false` always, as we don't adjust any
timezones?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]