19#if defined(__cpp_lib_format)
45 requires std::constructible_from<arrow_array_private_data::BufferType, B>
52 ArrowArray** children,
53 ArrowArray* dictionary
83 requires std::constructible_from<arrow_array_private_data::BufferType, B>
100 array.length = length;
101 array.null_count = null_count;
102 array.offset = offset;
106 array.buffers = private_data->buffers_ptrs<
void>();
107 array.n_children =
static_cast<int64_t
>(n_children);
108 array.children = children;
109 array.dictionary = dictionary;
114 requires std::constructible_from<arrow_array_private_data::BufferType, B>
132 fill_arrow_array(
array, length, null_count, offset, std::move(buffers), n_children, children, dictionary);
146 [[nodiscard]]
SPARROW_API std::vector<sparrow::buffer_view<uint8_t>>
166 copy_array(source_array, source_schema, target);
177 swap(source, target);
191#if defined(__cpp_lib_format)
196 constexpr auto parse(std::format_parse_context& ctx)
201 auto format(
const ArrowArray& obj, std::format_context& ctx)
const
203 std::string children_str = std::format(
"{}",
static_cast<void*
>(obj.
children));
206 children_str += std::format(
"\n-{}",
static_cast<void*
>(obj.
children[i]));
209 std::string buffer_str = std::format(
"{}",
static_cast<void*
>(obj.
buffers));
212 buffer_str += std::format(
"\n\t- {}", obj.
buffers[i]);
215 return std::format_to(
217 "ArrowArray - ptr address: {}\n- length: {}\n- null_count: {}\n- offset: {}\n- n_buffers: {}\n- buffers: {}\n- n_children: {}\n- children: {}\n- dictionary: {}\n",
218 static_cast<const void*
>(&obj),
233 os << std::format(
"{}", value);
Dynamically typed array encapsulating an Arrow layout.
Private data for ArrowArray.
std::vector< buffer< std::uint8_t > > BufferType
#define SPARROW_ASSERT_TRUE(expr__)
ArrowArray make_empty_arrow_array()
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.
void fill_arrow_array(ArrowArray &array, int64_t length, int64_t null_count, int64_t offset, B buffers, size_t n_children, ArrowArray **children, ArrowArray *dictionary)
Fill an ArrowArray object.
SPARROW_API sparrow::buffer_view< uint8_t > get_bitmap_buffer(const ArrowArray &array)
SPARROW_API std::vector< sparrow::buffer_view< uint8_t > > get_arrow_array_buffers(const ArrowArray &array, const ArrowSchema &schema)
std::ostream & operator<<(std::ostream &stream, T n)
SPARROW_API void release_arrow_array(ArrowArray *array)
Release function to use for the ArrowArray.release member.
ArrowArray make_arrow_array(int64_t length, int64_t null_count, int64_t offset, B buffers, size_t n_children, ArrowArray **children, ArrowArray *dictionary)
Creates an ArrowArray.
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