alamb commented on code in PR #9259:
URL: https://github.com/apache/arrow-rs/pull/9259#discussion_r2729505969
##########
arrow-json/src/reader/mod.rs:
##########
@@ -2815,4 +3021,67 @@ mod tests {
"Json error: whilst decoding field 'a': failed to parse \"a\" as
Int32".to_owned()
);
}
+
+ #[test]
+ fn test_decoder_factory() {
+ use arrow_array::builder;
+
+ struct AlwaysNullStringArrayDecoder;
+
+ impl ArrayDecoder for AlwaysNullStringArrayDecoder {
+ fn decode(&mut self, _tape: &Tape<'_>, pos: &[u32]) ->
Result<ArrayData, ArrowError> {
+ let mut builder = builder::StringBuilder::new();
+ for _ in pos {
+ builder.append_null();
+ }
+ Ok(builder.finish().into_data())
+ }
+ }
+
+ #[derive(Debug)]
+ struct AlwaysNullStringArrayDecoderFactory;
+
+ impl DecoderFactory for AlwaysNullStringArrayDecoderFactory {
+ fn make_custom_decoder(
+ &self,
Review Comment:
What do you think of the idea that the factory gets registered for each
column (rather than each type)?
https://github.com/apache/arrow-rs/pull/9021#discussion_r2729495830
--
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]