pitrou commented on code in PR #46271:
URL: https://github.com/apache/arrow/pull/46271#discussion_r2073784541
##########
cpp/src/arrow/array/data.h:
##########
@@ -194,25 +186,37 @@ struct ARROW_EXPORT ArrayData {
return *this;
}
+ /// \brief Return a shallow copy of this ArrayData
std::shared_ptr<ArrayData> Copy() const { return
std::make_shared<ArrayData>(*this); }
- /// \brief Copy all buffers and children recursively to destination
MemoryManager
+ /// \brief Deep copy this ArrayData to destination memory manager
///
- /// This utilizes MemoryManager::CopyBuffer to create a new ArrayData object
- /// recursively copying the buffers and all child buffers to the destination
- /// memory manager. This includes dictionaries if applicable.
+ /// Returns a new ArrayData object with buffers and all child buffers
+ /// copied to the destination memory manager. This includes dictionaries
+ /// if applicable.
Result<std::shared_ptr<ArrayData>> CopyTo(
const std::shared_ptr<MemoryManager>& to) const;
- /// \brief View or Copy this ArrayData to destination memory manager.
+
+ /// \brief View or copy this ArrayData to destination memory manager
///
/// Tries to view the buffer contents on the given memory manager's device
/// if possible (to avoid a copy) but falls back to copying if a no-copy view
/// isn't supported.
Result<std::shared_ptr<ArrayData>> ViewOrCopyTo(
const std::shared_ptr<MemoryManager>& to) const;
+ /// \brief Return the null-ness of a given array element
+ ///
+ /// Calling `IsNull(i)` is the same as `!IsValid(i)`.
bool IsNull(int64_t i) const { return !IsValid(i); }
+ /// \brief Return the validity of a given array element
+ ///
+ /// For most data types, this will simply query the validity bitmap.
+ /// For union and run-end-encoded arrays, the underlying child data is
+ /// queried instead.
+ /// For dictionary arrays, this reflects the validity of the dictionary
+ /// index, but the corresponding dictionary value might still be null.
Review Comment:
Ouch, sorry, I forgot to address this comment before merging. I'll create a
new issue for that.
--
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]