mapleFU commented on issue #38878:
URL: https://github.com/apache/arrow/issues/38878#issuecomment-1826759217
> pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries
(try to increase block size?)
This error might raise from the code below. How can I reproduce the problem
using C++ or Python code?
```c++
Status Chunker::ProcessWithPartial(std::shared_ptr<Buffer> partial,
std::shared_ptr<Buffer> block,
std::shared_ptr<Buffer>* completion,
std::shared_ptr<Buffer>* rest) {
if (partial->size() == 0) {
// If partial is empty, don't bother looking for completion
*completion = SliceBuffer(block, 0, 0);
*rest = block;
return Status::OK();
}
int64_t first_pos = -1;
RETURN_NOT_OK(boundary_finder_->FindFirst(std::string_view(*partial),
std::string_view(*block),
&first_pos));
if (first_pos == BoundaryFinder::kNoDelimiterFound) {
// No delimiter in block => the current object is too large for block
size
return StraddlingTooLarge();
} else {
*completion = SliceBuffer(block, 0, first_pos);
*rest = SliceBuffer(block, first_pos);
return Status::OK();
}
}
```
--
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]