etseidl commented on code in PR #8111:
URL: https://github.com/apache/arrow-rs/pull/8111#discussion_r2277737744
##########
parquet/src/basic.rs:
##########
@@ -227,84 +227,33 @@ struct TimestampType {
// they are identical
use TimestampType as TimeType;
-thrift_private_struct!(
+thrift_struct!(
struct IntType {
1: required i8 bit_width
2: required bool is_signed
}
);
-thrift_private_struct!(
+thrift_struct!(
struct VariantType {
// The version of the variant specification that the variant was
// written with.
1: optional i8 specification_version
}
);
-// TODO need macro for structs that need lifetime annotation
+thrift_struct!(
struct GeometryType<'a> {
- crs: Option<&'a str>,
-}
-
-impl<'a> TryFrom<&mut ThriftCompactInputProtocol<'a>> for GeometryType<'a> {
- type Error = ParquetError;
- fn try_from(prot: &mut ThriftCompactInputProtocol<'a>) -> Result<Self> {
- let mut crs: Option<&str> = None;
- prot.read_struct_begin()?;
- loop {
- let field_ident = prot.read_field_begin()?;
- if field_ident.field_type == FieldType::Stop {
- break;
- }
- match field_ident.id {
- 1 => {
- let val = prot.read_string()?;
- crs = Some(val);
- }
- _ => {
- prot.skip(field_ident.field_type)?;
- }
- };
- }
- Ok(Self { crs })
- }
+ 1: optional string<'a> crs;
}
+);
+thrift_struct!(
Review Comment:
Thanks @jhorstmann! I agree! 😄
--
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]