Rafferty97 commented on code in PR #9496:
URL: https://github.com/apache/arrow-rs/pull/9496#discussion_r3834825685
##########
arrow-json/src/reader/mod.rs:
##########
@@ -313,6 +317,25 @@ impl ReaderBuilder {
..self
}
}
+ /// Sets whether to flatten top-level arrays.
+ ///
+ /// * When `true`, each element of a top-level array will be treated as
its own row.
+ /// * When `false` (the default), the entire top-level array will be
treated as one row.
+ ///
+ /// For example, consider this input file:
+ /// ```text
+ /// [{ "a": 1 }, { "a": 2 }, { "b": 3 }]
+ /// [{ "a": 4 }, { "a": 5 }, { "b": 6 }]
+ /// ```
+ ///
+ /// By default, this would be parsed as two rows, each an array containing
three elements.
+ /// With this option set to `true`, however, this would be parsed as six
rows.
+ pub fn with_flatten(self, flatten_top_level_arrays: bool) -> Self {
Review Comment:
I'll add another paragraph - doesn't hurt.
--
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]