22#if defined(__cpp_lib_format)
51 template <
class B, std::ranges::input_range CHILDREN_OWNERSHIP>
52 requires std::constructible_from<arrow_array_private_data::BufferType, B>
53 && std::is_same_v<std::ranges::range_value_t<CHILDREN_OWNERSHIP>,
bool>
59 ArrowArray** children,
61 ArrowArray* dictionary,
94 template <
class B, std::ranges::input_range CHILDREN_OWNERSHIP>
96 std::constructible_from<arrow_array_private_data::BufferType, B>
97 && std::is_same_v<std::ranges::range_value_t<CHILDREN_OWNERSHIP>,
bool>
116 array.length = length;
117 array.null_count = null_count;
118 array.offset = offset;
126 array.buffers = private_data->buffers_ptrs<
void>();
128 array.children = children;
129 array.dictionary = dictionary;
133 template <
class B, std::ranges::input_range CHILDREN_OWNERSHIP>
134 requires std::constructible_from<arrow_array_private_data::BufferType, B>
135 && std::is_same_v<std::ranges::range_value_t<CHILDREN_OWNERSHIP>,
bool>
178 [[nodiscard]]
SPARROW_API std::vector<sparrow::buffer_view<uint8_t>>
201 copy_array(source_array, source_schema, target);
212 swap(source, target);
213 source.release(&source);
227#if defined(__cpp_lib_format)
232 constexpr auto parse(std::format_parse_context& ctx)
237 auto format(
const ArrowArray& obj, std::format_context& ctx)
const
239 std::string children_str = std::format(
"{}",
static_cast<void*
>(obj.
children));
242 children_str += std::format(
"\n-{}",
static_cast<void*
>(obj.
children[i]));
245 std::string buffer_str = std::format(
"{}",
static_cast<void*
>(obj.
buffers));
248 buffer_str += std::format(
"\n\t- {}", obj.
buffers[i]);
251 return std::format_to(
253 "ArrowArray - ptr address: {}\n- length: {}\n- null_count: {}\n- offset: {}\n- n_buffers: {}\n- buffers: {}\n- n_children: {}\n- children: {}\n- dictionary: {}\n",
254 static_cast<const void*
>(&obj),
269 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.
std::ostream & operator<<(std::ostream &os, const nullval_t &)
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...
struct ArrowArray ** children
struct ArrowArray * dictionary