masonh22 commented on code in PR #8028:
URL: https://github.com/apache/arrow-rs/pull/8028#discussion_r2243018346
##########
parquet/src/arrow/schema/complex.rs:
##########
@@ -568,12 +568,20 @@ fn convert_field(parquet_type: &Type, field:
&ParquetField, arrow_hint: Option<&
let mut ret = Field::new(name, data_type, nullable);
let basic_info = parquet_type.get_basic_info();
if basic_info.has_id() {
- let mut meta = HashMap::with_capacity(1);
- meta.insert(
+ ret.metadata_mut().insert(
PARQUET_FIELD_ID_META_KEY.to_string(),
basic_info.id().to_string(),
);
- ret.set_metadata(meta);
+ }
+ if matches!(
+ basic_info.logical_type(),
+ Some(LogicalType::Time {
+ is_adjusted_to_u_t_c: true,
+ ..
+ })
+ ) {
+ ret.metadata_mut()
+ .insert(ADJUSTED_TO_UTC_KEY.to_string(), String::new());
Review Comment:
Note that we're not adding this if an arrow hint was found. We probably
want to add it in both cases, right?
##########
parquet/src/arrow/mod.rs:
##########
@@ -221,6 +221,15 @@ pub const ARROW_SCHEMA_META_KEY: &str = "ARROW:schema";
/// [`BasicTypeInfo::id`]: crate::schema::types::BasicTypeInfo::id
pub const PARQUET_FIELD_ID_META_KEY: &str = "PARQUET:field_id";
+/// Metadata key whose presence on [`Field::metadata`] indicates that a
+/// [`DataType::Time32`] or [`DataType::Time64`] is adjusted to UTC as defined
+/// in the parquet spec.
+///
+/// [`Field::metadata`]: arrow_schema::Field::metadata
+/// [`DataType::Time32`]: arrow_schema::DataType::Time32
+/// [`DataType::Time64`]: arrow_schema::DataType::Time64
Review Comment:
Did I do these links right? How can I verify this? I've never done this
before...
--
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]