jecsand838 commented on code in PR #8595:
URL: https://github.com/apache/arrow-rs/pull/8595#discussion_r2430077931
##########
arrow-avro/src/writer/encoder.rs:
##########
@@ -1118,6 +1238,32 @@ impl<'a, P: ArrowPrimitiveType<Native = i64>>
LongEncoder<'a, P> {
}
}
+/// Time32(Second) to Avro time-millis (int), via safe scaling by 1000
+struct Time32SecondsToMillisEncoder<'a>(&'a PrimitiveArray<Time32SecondType>);
Review Comment:
This is a great callout and it crossed my mind as well. Initially I tried to
abstract `TimestampSecondsToMillisEncoder` and `Time32SecondsToMillisEncoder`
several different ways, however each attempt resulted in more complexity and
more code. I tried approaches with involving traits, generics, and macros.
So I went with the rule of three on this one. My thinking is if the need for
a third scaling encoder comes up, I could tackle it then.
--
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]