Weijun-H commented on code in PR #9097:
URL: https://github.com/apache/arrow-rs/pull/9097#discussion_r2664616838
##########
arrow-json/src/reader/tape.rs:
##########
@@ -449,7 +481,52 @@ impl TapeDecoder {
DecoderState::Colon => {
iter.skip_whitespace();
match next!(iter) {
- b':' => self.stack.pop(),
+ b':' => {
+ self.stack.pop();
+
+ // Check projection: if the field is not in the
projection set,
+ // replace the Value state with SkipValue
+ // NOTE: Only apply projection at the top level
(nesting_depth == 1)
+ // This means direct fields of the root object,
not nested objects
+ if self.current_nesting_depth == 1 {
+ if let Some(ref projection) = self.projection {
+ // Get the field name from the last String
element
+ if let
Some(TapeElement::String(string_idx)) =
+ self.elements.last()
Review Comment:
MSRV is Rust 1.85, it doesn't support if-let chaining. I used a helper to
simplify it in
https://github.com/apache/arrow-rs/pull/9097/commits/70ad83a37ff0f53561170710f373a342aa26f495
--
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]