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