alamb commented on code in PR #10897:
URL: https://github.com/apache/arrow-rs/pull/10897#discussion_r3913546693


##########
arrow-json/src/reader/mod.rs:
##########
@@ -49,11 +49,11 @@
 //!
 //! # Async Usage
 //!
-//! The lower-level [`Decoder`] can be integrated with various forms of async 
data streams,
-//! and is designed to be agnostic to the various different kinds of async IO 
primitives found
+//! The lower-level [`Decoder`] can be integrated with various forms of async

Review Comment:
   drive by to make the text clearer



##########
arrow-json/src/reader/mod.rs:
##########
@@ -132,6 +132,14 @@
 //! }
 //! ```
 //!
+//! # Customizing the decoder

Review Comment:
   This is the main purpose of this PR: leave a note here about how to 
customize the decoder



##########
arrow-json/src/writer/encoder.rs:
##########
@@ -149,8 +149,13 @@ impl EncoderOptions {
 ///
 /// [`WriterBuilder::with_encoder_factory`]: 
crate::writer::WriterBuilder::with_encoder_factory
 ///
-/// # Examples
+/// # Example: Encode a `BinaryArray` as an array of integers

Review Comment:
   I tried to make the examples here a little clearer and added some more 
explanatory docs



##########
arrow-json/src/lib.rs:
##########
@@ -29,11 +29,13 @@
 //! Note that `Base16` only has 50% space efficiency (i.e., the encoded data 
is twice as large
 //! as the original). If that is an issue, there are two alternatives:
 //!
-//! 1. Provide a custom encoder. See the [Customizing the encoder] section of 
the writer documentation.
+//! 1. Provide a custom encoder and/or decoder. See the [Customizing the 
encoder] section of the
+//!    writer documentation and the [Customizing the decoder] section of the 
reader documentation.
 //! 2. Convert binary data to/from a different encoding format such as 
`Base64` before
 //!    writing / after reading, as shown in the following example.
 //!
 //! [Customizing the encoder]: writer#customizing-the-encoder
+//! [Customizing the decoder]: reader#customizing-the-decoder

Review Comment:
   here is the main entry to help people find the new feature



##########
arrow-json/src/reader/mod.rs:
##########
@@ -766,9 +775,11 @@ pub trait ArrayDecoder: Send {
 /// handle. The reader-side counterpart of [`EncoderFactory`]; register an
 /// implementation with [`ReaderBuilder::with_decoder_factory`].
 ///
-/// # Examples
+/// # Example: Decode `Binary` from a JSON array of integers

Review Comment:
   The example originally showed how to use the decoder factory as well as 
switch on the extension type. I think it would be clearer to have separate 
examples, so I split it into two examples and added some comments



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