sergiimk opened a new issue, #6478: URL: https://github.com/apache/arrow-datafusion/issues/6478
### Describe the bug I live in a painful world of ensuring three different SQL engines (Spark, Flink, Datafusion) interoperate via Parquet. Spark is far behind on keeping up with Parquet spec. We configure it to write `TIMESTAMP` type as `TIMESTAMP_MILLIS` logical type, instead of the long-deprecated `int96` it uses by default ... but `TIMESTAMP_MILLIS` is also deprecated in favor of `TIMESTAMP(precision, isAdjustedToUtc)`. [Parquet spec prescribes](https://github.com/apache/parquet-format/blob/master/LogicalTypes.md#deprecated-timestamp-convertedtype) that for backward compatibility `TIMESTAMP_MILLIS` should be interpreted as `TimestampType (isAdjustedToUTC = true, unit = MILLIS)`, but this doesn't seem like what Datafusion is doing. ### To Reproduce Read a modern Parquet file with schema: ``` message x { REQUIRED INT64 system_time (TIMESTAMP(MILLIS,true)); } ```` observe field: `Field { name: "system_time", data_type: Timestamp(Millisecond, Some("UTC")), nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }` Read an old Parquet file with schema: ``` message x { REQUIRED INT64 system_time (TIMESTAMP_MILLIS); } ```` observe data frame field: `Field { name: "system_time", data_type: Timestamp(Millisecond, None), nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }` `TIMESTAMP_MILLIS` gets incorrectly interpreted as naive/local timestamp. ### Expected behavior Because spec prescribes that `TIMESTAMP_MILLIS` should be interpreted as `TIMESTAMP(MILLIS,true)` I expected to see a timestamp with UTC timezone. ### Additional context _No response_ -- 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]
