tustvold commented on code in PR #6606:
URL: https://github.com/apache/arrow-rs/pull/6606#discussion_r1808298785


##########
arrow-json/src/writer/encoder.rs:
##########
@@ -545,3 +555,37 @@ where
         out.push(b'"');
     }
 }
+
+struct Decimal128Encoder<'a> {
+    array: &'a Decimal128Array,
+}
+
+impl<'a> Decimal128Encoder<'a> {
+    fn new(array: &'a Decimal128Array) -> Self {
+        Self { array }
+    }
+}
+
+impl<'a> Encoder for Decimal128Encoder<'a> {
+    fn encode(&mut self, idx: usize, out: &mut Vec<u8>) {
+        let formatted = self.array.value_as_string(idx);

Review Comment:
   Yes you will need to keep the custom encoder as a newtype as unlike the 
implementation for ArrayFormatter above, you don't want to write the quote 
characters



-- 
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]

Reply via email to