| 1571 | } |
| 1572 | |
| 1573 | Status ImportChild(const ArrayImporter* parent, struct ArrowArray* src) { |
| 1574 | if (ArrowArrayIsReleased(src)) { |
| 1575 | return Status::Invalid("Cannot import released ArrowArray"); |
| 1576 | } |
| 1577 | recursion_level_ = parent->recursion_level_ + 1; |
| 1578 | if (recursion_level_ >= kMaxImportRecursionLevel) { |
| 1579 | return Status::Invalid("Recursion level in ArrowArray struct exceeded"); |
| 1580 | } |
| 1581 | device_type_ = parent->device_type_; |
| 1582 | memory_mgr_ = parent->memory_mgr_; |
| 1583 | // Child buffers will keep the entire parent import alive. |
| 1584 | // Perhaps we can move the child structs to an owned area |
| 1585 | // when the parent ImportedArrayData::Release() gets called, |
| 1586 | // but that is another level of complication. |
| 1587 | import_ = parent->import_; |
| 1588 | // The ArrowArray shouldn't be moved, it's owned by its parent |
| 1589 | c_struct_ = src; |
| 1590 | return DoImport(); |
| 1591 | } |
| 1592 | |
| 1593 | Status ImportDict(const ArrayImporter* parent, struct ArrowArray* src) { |
| 1594 | return ImportChild(parent, src); |
no test coverage detected