You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "tustvold (via GitHub)" <gi...@apache.org> on 2023/05/22 14:26:00 UTC

[GitHub] [arrow-rs] tustvold commented on a diff in pull request #4259: Extract IPC ArrayReader struct

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


##########
arrow-ipc/src/reader.rs:
##########
@@ -334,125 +205,21 @@ fn create_array(
                 .offset(0)
                 .build()
                 .unwrap();
-            node_index += 1;
             // no buffer increases
-            make_array(data)
-        }
-        _ => {
-            if nodes.len() <= node_index {
-                return Err(ArrowError::IoError(format!(
-                    "Invalid data for schema. {} refers to node index {} but only {} in schema",
-                    field, node_index, nodes.len()
-                )));
-            }
-            let array = create_primitive_array(
-                nodes.get(node_index),
-                data_type,
-                &[
-                    read_buffer(buffers.get(buffer_index), data, compression_codec)?,
-                    read_buffer(buffers.get(buffer_index + 1), data, compression_codec)?,
-                ],
-            )?;
-            node_index += 1;
-            buffer_index += 2;
-            array
-        }
-    };
-    Ok((array, node_index, buffer_index))
-}
-
-/// Skip fields based on data types to advance `node_index` and `buffer_index`.
-/// This function should be called when doing projection in fn `read_record_batch`.
-/// The advancement logic references fn `create_array`.
-fn skip_field(

Review Comment:
   This logic is moved into skip_node



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org