etseidl commented on code in PR #8237: URL: https://github.com/apache/arrow-rs/pull/8237#discussion_r2337671497
########## parquet/src/parquet_macros.rs: ########## @@ -228,14 +306,86 @@ macro_rules! thrift_struct { }) } } + + impl $(<$lt>)? WriteThrift for $identifier $(<$lt>)? { + const ELEMENT_TYPE: ElementType = ElementType::Struct; + + #[allow(unused_assignments)] + fn write_thrift<W: Write>(&self, writer: &mut ThriftCompactOutputProtocol<W>) -> Result<()> { + let mut last_field_id = 0i16; + $($crate::__thrift_write_required_or_optional_field!($required_or_optional $field_name, $field_id, $field_type, self, writer, last_field_id);)* + writer.write_struct_end() + } + } + + impl $(<$lt>)? WriteThriftField for $identifier $(<$lt>)? { + fn write_thrift_field<W: Write>(&self, writer: &mut ThriftCompactOutputProtocol<W>, field_id: i16, last_field_id: i16) -> Result<i16> { + writer.write_field_begin(FieldType::Struct, field_id, last_field_id)?; + self.write_thrift(writer)?; + Ok(field_id) + } + } } } -/// macro to use when decoding struct fields +#[doc(hidden)] Review Comment: @jhorstmann added some to his macros that I will steal and expand upon. Right now I've got six more branches to go that all depend on the preceding one, so I don't want to make too many changes here...I'll instead start a list of all the places I need more documentation and make those changes once the full end-to-end is done. -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org