22#if defined(__cpp_lib_format)
48 template <
class B, std::ranges::input_range CHILDREN_OWNERSHIP>
49 requires std::constructible_from<arrow_array_private_data::BufferType, B>
50 && std::is_same_v<std::ranges::range_value_t<CHILDREN_OWNERSHIP>,
bool>
56 ArrowArray** children,
58 ArrowArray* dictionary,
88 template <
class B, std::ranges::input_range CHILDREN_OWNERSHIP>
90 std::constructible_from<arrow_array_private_data::BufferType, B>
91 && std::is_same_v<std::ranges::range_value_t<CHILDREN_OWNERSHIP>,
bool>
110 array.length = length;
111 array.null_count = null_count;
112 array.offset = offset;
120 array.buffers = private_data->buffers_ptrs<
void>();
122 array.children = children;
123 array.dictionary = dictionary;
127 template <
class B, std::ranges::input_range CHILDREN_OWNERSHIP>
128 requires std::constructible_from<arrow_array_private_data::BufferType, B>
129 && std::is_same_v<std::ranges::range_value_t<CHILDREN_OWNERSHIP>,
bool>
172 [[nodiscard]]
SPARROW_API std::vector<sparrow::buffer_view<uint8_t>>
195 copy_array(source_array, source_schema, target);
206 swap(source, target);
207 source.release(&source);
221#if defined(__cpp_lib_format)
226 constexpr auto parse(std::format_parse_context& ctx)
231 auto format(
const ArrowArray& obj, std::format_context& ctx)
const
233 std::string children_str = std::format(
"{}",
static_cast<void*
>(obj.
children));
236 children_str += std::format(
"\n-{}",
static_cast<void*
>(obj.
children[i]));
239 std::string buffer_str = std::format(
"{}",
static_cast<void*
>(obj.
buffers));
242 buffer_str += std::format(
"\n\t- {}", obj.
buffers[i]);
245 return std::format_to(
247 "ArrowArray - ptr address: {}\n- length: {}\n- null_count: {}\n- offset: {}\n- n_buffers: {}\n- buffers: {}\n- n_children: {}\n- children: {}\n- dictionary: {}\n",
248 static_cast<const void*
>(&obj),
263 os << std::format(
"{}", value);
Dynamically typed array encapsulating an Arrow layout.
Private data for ArrowArray.
std::vector< buffer< std::uint8_t > > BufferType
A view that repeats a value a given number of times.
#define SPARROW_ASSERT_TRUE(expr__)
ArrowArray make_empty_arrow_array()
void fill_arrow_array(ArrowArray &array, int64_t length, int64_t null_count, int64_t offset, B buffers, ArrowArray **children, const CHILDREN_OWNERSHIP &children_ownership, ArrowArray *dictionary, bool dictionary_ownership)
Fill an ArrowArray object.
constexpr int64_t ssize(const T &value)
Get the size of a range, a tuple or an optional.
SPARROW_API void swap(ArrowArray &lhs, ArrowArray &rhs)
Swaps the contents of the two ArrowArray objects.
SPARROW_API void copy_array(const ArrowArray &source_array, const ArrowSchema &source_schema, ArrowArray &target)
Fill the target ArrowArray with a deep copy of the data from the source ArrowArray.
SPARROW_API void empty_release_arrow_array(ArrowArray *array)
Empty release function to use for the ArrowArray.release member.
SPARROW_API sparrow::buffer_view< uint8_t > get_bitmap_buffer(const ArrowArray &array)
ArrowArray make_arrow_array(int64_t length, int64_t null_count, int64_t offset, B buffers, ArrowArray **children, const CHILDREN_OWNERSHIP &children_ownership, ArrowArray *dictionary, bool dictionary_ownership)
Creates an ArrowArray.
SPARROW_API std::vector< sparrow::buffer_view< uint8_t > > get_arrow_array_buffers(const ArrowArray &array, const ArrowSchema &schema)
SPARROW_API void release_arrow_array(ArrowArray *array)
Release function to use for the ArrowArray.release member.
ArrowArray move_array(ArrowArray &&source)
Moves the content of source into a stack-allocated array, and reset the source to an empty ArrowArray...
std::ostream & operator<<(std::ostream &os, const sparrow::nullval_t &)
struct ArrowArray ** children
struct ArrowArray * dictionary