rok commented on code in PR #55348:
URL: https://github.com/apache/arrow/pull/55348#discussion_r4633111168
##########
cpp/src/parquet/arrow/writer.cc:
##########
@@ -281,6 +431,14 @@ class ArrowColumnWriterV2 {
// The chunk offset here will be 0 except for possibly the first chunk
// because of the advancing logic above
std::shared_ptr<Array> array_to_write = chunk.Slice(chunk_offset,
chunk_write_size);
+ if (root_field != nullptr) {
+ ARROW_ASSIGN_OR_RAISE(
+ std::shared_ptr<ArrayData> prepared,
+ MakeFiniteVectorElementsRequired(array_to_write->data(),
*root_field));
Review Comment:
Done: each column now checks once, before the chunk loop, whether its schema
subtree has a FINITE_VECTOR, and skips the helper otherwise. I didn't benchmark
it. The helper only walks the type tree (not the values) and returns the input
unchanged when there's nothing to do, so I'd expect the difference to be in the
noise.
##########
cpp/src/parquet/schema.cc:
##########
@@ -364,6 +423,10 @@ GroupNode::GroupNode(const std::string& name,
Repetition::type repetition,
field->SetParent(this);
Review Comment:
Good catch. I moved the check ahead of the `SetParent` loop, so a rejected
group is never left as the parent of its fields. Also added a test that the
child's parent stays null after the throw.
--
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]