tustvold commented on issue #2984:
URL: https://github.com/apache/arrow-rs/issues/2984#issuecomment-1299074771
Oh I got confused, parquet has TIME and TIMESTAMP :facepalm:
> TIMESTAMP_MILLIS is the deprecated ConvertedType counterpart of a
TIMESTAMP logical type that is UTC normalized and has MILLIS precision. Like
the logical type counterpart, it must annotate an int64.
>
> TIMESTAMP_MICROS is the deprecated ConvertedType counterpart of a
TIMESTAMP logical type that is UTC normalized and has MICROS precision. Like
the logical type counterpart, it must annotate an int64.
So they should both be Int64.
Taking a step back, the following test passes so I am not sure how to
reproduce your issue
```
#[test]
fn test_timestamp() {
let t= Type::primitive_type_builder("foo", PhysicalType::INT64)
.with_logical_type(Some(LogicalType::Timestamp {
is_adjusted_to_u_t_c: false,
unit: TimeUnit::MICROS(MicroSeconds {}),
}))
.with_repetition(Repetition::OPTIONAL)
.build()
.unwrap();
assert_eq!(t.get_basic_info().converted_type,
ConvertedType::TIMESTAMP_MICROS);
let t= Type::primitive_type_builder("foo", PhysicalType::INT64)
.with_logical_type(Some(LogicalType::Timestamp {
is_adjusted_to_u_t_c: false,
unit: TimeUnit::MILLIS(MilliSeconds {}),
}))
.with_repetition(Repetition::OPTIONAL)
.build()
.unwrap();
assert_eq!(t.get_basic_info().converted_type,
ConvertedType::TIMESTAMP_MILLIS);
}
```
--
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]