sparrow 0.6.0
Loading...
Searching...
No Matches
list_array.hpp
Go to the documentation of this file.
1// Copyright 2024 Man Group Operations Limited
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#pragma once
16
17#include <string> // for std::stoull
18#include <type_traits>
19#include <vector>
20
21#include "sparrow/array_api.hpp"
36
37namespace sparrow
38{
39 template <class DERIVED>
41
42 template <bool BIG>
43 class list_array_impl;
44
45 template <bool BIG>
47
50
53
55
59 template <class T>
60 constexpr bool is_list_array_v = std::same_as<T, list_array>;
61
65 template <class T>
66 constexpr bool is_big_list_array_v = std::same_as<T, big_list_array>;
67
71 template <class T>
72 constexpr bool is_list_view_array_v = std::same_as<T, list_view_array>;
73
77 template <class T>
78 constexpr bool is_big_list_view_array_v = std::same_as<T, big_list_view_array>;
79
83 template <class T>
84 constexpr bool is_fixed_sized_list_array_v = std::same_as<T, fixed_sized_list_array>;
85
86 namespace detail
87 {
88 template <class T>
89 struct get_data_type_from_array;
90
91 template <>
93 {
94 [[nodiscard]] static constexpr sparrow::data_type get()
95 {
97 }
98 };
99
100 template <>
102 {
103 [[nodiscard]] static constexpr sparrow::data_type get()
104 {
106 }
107 };
108
109 template <>
111 {
112 [[nodiscard]] static constexpr sparrow::data_type get()
113 {
115 }
116 };
117
118 template <>
120 {
121 [[nodiscard]] static constexpr sparrow::data_type get()
122 {
124 }
125 };
126
127 template <>
129 {
130 [[nodiscard]] static constexpr sparrow::data_type get()
131 {
133 }
134 };
135 }
136
137 template <bool BIG>
150
151 template <bool BIG>
164
165 template <>
178
179 // using list_array = list_array_crtp_base<false>;
180 // using big_list_array = list_array_crtp_base<true>;
181
182 // this is the base class for
183 // - list-array
184 // - big-list-array
185 // - list-view-array
186 // - big-list-view-array
187 // - fixed-size-list-array
188 template <class DERIVED>
190 {
191 public:
192
196 using value_iterator = typename inner_types::value_iterator;
197 using const_value_iterator = typename inner_types::const_value_iterator;
199
201 // using bitmap_reference = typename base_type::bitmap_reference;
203
204 // using bitmap_range = typename base_type::bitmap_range;
206
210
212 // using reference = nullable<inner_reference, bitmap_reference>;
215
216 [[nodiscard]] const array_wrapper* raw_flat_array() const;
218
219 protected:
220
222
225
228
229 private:
230
231 using list_size_type = inner_types::list_size_type;
232
233 [[nodiscard]] value_iterator value_begin();
234 [[nodiscard]] value_iterator value_end();
235 [[nodiscard]] const_value_iterator value_cbegin() const;
236 [[nodiscard]] const_value_iterator value_cend() const;
237
238 [[nodiscard]] inner_reference value(size_type i);
239 [[nodiscard]] inner_const_reference value(size_type i) const;
240
241 [[nodiscard]] cloning_ptr<array_wrapper> make_flat_array();
242
243 // data members
245
246 // friend classes
247 friend class array_crtp_base<DERIVED>;
248
249 // needs access to this->value(i)
250 friend class detail::layout_value_functor<DERIVED, inner_value_type>;
251 friend class detail::layout_value_functor<const DERIVED, inner_value_type>;
252 };
253
254 template <bool BIG>
255 class list_array_impl final : public list_array_crtp_base<list_array_impl<BIG>>
256 {
257 public:
258
262 using list_size_type = inner_types::list_size_type;
264 using offset_type = std::conditional_t<BIG, const std::int64_t, const std::int32_t>;
266
268
271
274
275 template <class... ARGS>
277 explicit list_array_impl(ARGS&&... args)
278 : self_type(create_proxy(std::forward<ARGS>(args)...))
279 {
280 }
281
282 template <std::ranges::range SIZES_RANGE>
283 [[nodiscard]] static auto offset_from_sizes(SIZES_RANGE&& sizes) -> offset_buffer_type;
284
285 private:
286
287 template <
289 input_metadata_container METADATA_RANGE = std::vector<metadata_pair>>
290 [[nodiscard]] static arrow_proxy create_proxy(
291 array&& flat_values,
292 offset_buffer_type&& list_offsets,
293 VB&& validity_input = validity_bitmap{},
294 std::optional<std::string_view> name = std::nullopt,
295 std::optional<METADATA_RANGE> metadata = std::nullopt
296 );
297
298 static constexpr std::size_t OFFSET_BUFFER_INDEX = 1;
299 [[nodiscard]] std::pair<offset_type, offset_type> offset_range(size_type i) const;
300
301 [[nodiscard]] offset_type* make_list_offsets();
302
303 offset_type* p_list_offsets;
304
305 // friend classes
306 friend class array_crtp_base<self_type>;
307 friend class list_array_crtp_base<self_type>;
308 };
309
310 template <bool BIG>
311 class list_view_array_impl final : public list_array_crtp_base<list_view_array_impl<BIG>>
312 {
313 public:
314
318 using list_size_type = inner_types::list_size_type;
320 using offset_type = std::conditional_t<BIG, const std::int64_t, const std::int32_t>;
323
325
328
331
332 template <class... ARGS>
334 list_view_array_impl(ARGS&&... args)
335 : self_type(create_proxy(std::forward<ARGS>(args)...))
336 {
337 }
338
339 private:
340
341 template <
343 input_metadata_container METADATA_RANGE = std::vector<metadata_pair>>
344 [[nodiscard]] static arrow_proxy create_proxy(
345 array&& flat_values,
346 offset_buffer_type&& list_offsets,
347 size_buffer_type&& list_sizes,
348 VB&& validity_input = validity_bitmap{},
349 std::optional<std::string_view> name = std::nullopt,
350 std::optional<METADATA_RANGE> metadata = std::nullopt
351 );
352
353 static constexpr std::size_t OFFSET_BUFFER_INDEX = 1;
354 static constexpr std::size_t SIZES_BUFFER_INDEX = 2;
355 [[nodiscard]] std::pair<offset_type, offset_type> offset_range(size_type i) const;
356
357 [[nodiscard]] offset_type* make_list_offsets();
358 [[nodiscard]] offset_type* make_list_sizes();
359
360 offset_type* p_list_offsets;
361 offset_type* p_list_sizes;
362
363 // friend classes
364 friend class array_crtp_base<self_type>;
365 friend class list_array_crtp_base<self_type>;
366 };
367
368 class fixed_sized_list_array final : public list_array_crtp_base<fixed_sized_list_array>
369 {
370 public:
371
375 using list_size_type = inner_types::list_size_type;
377 using offset_type = std::uint64_t;
378
379 explicit fixed_sized_list_array(arrow_proxy proxy);
380
383
386
387 template <class... ARGS>
390 : self_type(create_proxy(std::forward<ARGS>(args)...))
391 {
392 }
393
394 private:
395
396 template <
398 input_metadata_container METADATA_RANGE = std::vector<metadata_pair>>
399 [[nodiscard]] static arrow_proxy create_proxy(
400 std::uint64_t list_size,
401 array&& flat_values,
402 R&& validity_input = validity_bitmap{},
403 std::optional<std::string_view> name = std::nullopt,
404 std::optional<METADATA_RANGE> metadata = std::nullopt
405 );
406
407 [[nodiscard]] static uint64_t list_size_from_format(const std::string_view format);
408 [[nodiscard]] std::pair<offset_type, offset_type> offset_range(size_type i) const;
409
410 uint64_t m_list_size;
411
412 // friend classes
413 friend class array_crtp_base<self_type>;
414 friend class list_array_crtp_base<self_type>;
415 };
416
417 /***************************************
418 * list_array_crtp_base implementation *
419 ***************************************/
420
421 template <class DERIVED>
423 : base_type(std::move(proxy))
424 , p_flat_array(make_flat_array())
425 {
426 }
427
428 template <class DERIVED>
430 : base_type(rhs)
431 , p_flat_array(make_flat_array())
432 {
433 }
434
435 template <class DERIVED>
437 {
439 p_flat_array = make_flat_array();
440 return *this;
441 }
442
443 template <class DERIVED>
445 {
446 return p_flat_array.get();
447 }
448
449 template <class DERIVED>
451 {
452 return p_flat_array.get();
453 }
454
455 template <class DERIVED>
456 auto list_array_crtp_base<DERIVED>::value_begin() -> value_iterator
457 {
458 return value_iterator(detail::layout_value_functor<DERIVED, inner_value_type>(&this->derived_cast()), 0);
459 }
460
461 template <class DERIVED>
462 auto list_array_crtp_base<DERIVED>::value_end() -> value_iterator
463 {
464 return value_iterator(
465 detail::layout_value_functor<DERIVED, inner_value_type>(&this->derived_cast()),
466 this->size()
467 );
468 }
469
470 template <class DERIVED>
471 auto list_array_crtp_base<DERIVED>::value_cbegin() const -> const_value_iterator
472 {
473 return const_value_iterator(
475 0
476 );
477 }
478
479 template <class DERIVED>
480 auto list_array_crtp_base<DERIVED>::value_cend() const -> const_value_iterator
481 {
482 return const_value_iterator(
484 this->size()
485 );
486 }
487
488 template <class DERIVED>
489 auto list_array_crtp_base<DERIVED>::value(size_type i) -> inner_reference
490 {
491 const auto r = this->derived_cast().offset_range(i);
492 using st = typename list_value::size_type;
493 return list_value{p_flat_array.get(), static_cast<st>(r.first), static_cast<st>(r.second)};
494 }
495
496 template <class DERIVED>
497 auto list_array_crtp_base<DERIVED>::value(size_type i) const -> inner_const_reference
498 {
499 const auto r = this->derived_cast().offset_range(i);
500 using st = typename list_value::size_type;
501 return list_value{p_flat_array.get(), static_cast<st>(r.first), static_cast<st>(r.second)};
502 }
503
504 template <class DERIVED>
505 cloning_ptr<array_wrapper> list_array_crtp_base<DERIVED>::make_flat_array()
506 {
507 return array_factory(this->get_arrow_proxy().children()[0].view());
508 }
509
510 /**********************************
511 * list_array_impl implementation *
512 **********************************/
513
514#ifdef __GNUC__
515# pragma GCC diagnostic push
516# pragma GCC diagnostic ignored "-Wcast-align"
517#endif
518
519 template <bool BIG>
521 : base_type(std::move(proxy))
522 , p_list_offsets(make_list_offsets())
523 {
524 }
525
526 template <bool BIG>
527 template <std::ranges::range SIZES_RANGE>
529 {
530 return detail::offset_buffer_from_sizes<std::remove_const_t<offset_type>>(std::forward<SIZES_RANGE>(sizes
531 ));
532 }
533
534 template <bool BIG>
535 template <validity_bitmap_input VB, input_metadata_container METADATA_RANGE>
536 arrow_proxy list_array_impl<BIG>::create_proxy(
537 array&& flat_values,
538 offset_buffer_type&& list_offsets,
539 VB&& validity_input,
540 std::optional<std::string_view> name,
541 std::optional<METADATA_RANGE> metadata
542 )
543 {
544 const auto size = list_offsets.size() - 1;
545 validity_bitmap vbitmap = ensure_validity_bitmap(size, std::forward<VB>(validity_input));
546
547 auto [flat_arr, flat_schema] = extract_arrow_structures(std::move(flat_values));
548
549 const auto null_count = vbitmap.null_count();
551
553 BIG ? std::string("+L") : std::string("+l"), // format
554 name, // name
555 metadata, // metadata
556 std::nullopt, // flags,
557 new ArrowSchema*[1]{new ArrowSchema(std::move(flat_schema))}, // children
558 children_ownership, // children ownership
559 nullptr, // dictionary
560 true // dictionary ownership
561
562 );
563 std::vector<buffer<std::uint8_t>> arr_buffs = {
564 std::move(vbitmap).extract_storage(),
565 std::move(list_offsets).extract_storage()
566 };
567
568 ArrowArray arr = make_arrow_array(
569 static_cast<std::int64_t>(size), // length
570 static_cast<int64_t>(null_count),
571 0, // offset
572 std::move(arr_buffs),
573 new ArrowArray*[1]{new ArrowArray(std::move(flat_arr))}, // children
574 children_ownership, // children ownership
575 nullptr, // dictionary
576 true // dictionary ownership
577 );
578 return arrow_proxy{std::move(arr), std::move(schema)};
579 }
580
581 template <bool BIG>
583 : base_type(rhs)
584 , p_list_offsets(make_list_offsets())
585 {
586 }
587
588 template <bool BIG>
590 {
591 if (this != &rhs)
592 {
594 p_list_offsets = make_list_offsets();
595 }
596 return *this;
597 }
598
599 template <bool BIG>
600 auto list_array_impl<BIG>::offset_range(size_type i) const -> std::pair<offset_type, offset_type>
601 {
602 return std::make_pair(p_list_offsets[i], p_list_offsets[i + 1]);
603 }
604
605 template <bool BIG>
606 auto list_array_impl<BIG>::make_list_offsets() -> offset_type*
607 {
608 return reinterpret_cast<offset_type*>(
609 this->get_arrow_proxy().buffers()[OFFSET_BUFFER_INDEX].data() + this->get_arrow_proxy().offset()
610 );
611 }
612
613 /***************************************
614 * list_view_array_impl implementation *
615 ***************************************/
616
617 template <bool BIG>
619 : base_type(std::move(proxy))
620 , p_list_offsets(make_list_offsets())
621 , p_list_sizes(make_list_sizes())
622 {
623 }
624
625 template <bool BIG>
626 template <validity_bitmap_input VB, input_metadata_container METADATA_RANGE>
627 arrow_proxy list_view_array_impl<BIG>::create_proxy(
628 array&& flat_values,
629 offset_buffer_type&& list_offsets,
630 size_buffer_type&& list_sizes,
631 VB&& validity_input,
632 std::optional<std::string_view> name,
633 std::optional<METADATA_RANGE> metadata
634 )
635 {
636 SPARROW_ASSERT(list_offsets.size() == list_sizes.size(), "sizes and offset must have the same size");
637
638 const auto size = list_sizes.size();
639 validity_bitmap vbitmap = ensure_validity_bitmap(size, std::forward<VB>(validity_input));
640
641 auto [flat_arr, flat_schema] = extract_arrow_structures(std::move(flat_values));
642
643 const auto null_count = vbitmap.null_count();
644
646
648 BIG ? std::string("+vL") : std::string("+vl"), // format
649 name, // name
650 metadata, // metadata
651 std::nullopt, // flags,
652 new ArrowSchema*[1]{new ArrowSchema(std::move(flat_schema))}, // children
654 nullptr, // dictionary
655 true
656 );
657 std::vector<buffer<std::uint8_t>> arr_buffs = {
658 std::move(vbitmap).extract_storage(),
659 std::move(list_offsets).extract_storage(),
660 std::move(list_sizes).extract_storage()
661 };
662
663 ArrowArray arr = make_arrow_array(
664 static_cast<std::int64_t>(size), // length
665 static_cast<int64_t>(null_count),
666 0, // offset
667 std::move(arr_buffs),
668 new ArrowArray*[1]{new ArrowArray(std::move(flat_arr))}, // children
670 nullptr, // dictionary
671 true
672 );
673 return arrow_proxy{std::move(arr), std::move(schema)};
674 }
675
676 template <bool BIG>
678 : base_type(rhs)
679 , p_list_offsets(make_list_offsets())
680 , p_list_sizes(make_list_sizes())
681 {
682 }
683
684 template <bool BIG>
686 {
687 if (this != &rhs)
688 {
690 p_list_offsets = make_list_offsets();
691 p_list_sizes = make_list_sizes();
692 }
693 return *this;
694 }
695
696 template <bool BIG>
697 inline auto list_view_array_impl<BIG>::offset_range(size_type i) const
698 -> std::pair<offset_type, offset_type>
699 {
700 const auto offset = p_list_offsets[i];
701 return std::make_pair(offset, offset + p_list_sizes[i]);
702 }
703
704 template <bool BIG>
705 auto list_view_array_impl<BIG>::make_list_offsets() -> offset_type*
706 {
707 return reinterpret_cast<offset_type*>(
708 this->get_arrow_proxy().buffers()[OFFSET_BUFFER_INDEX].data() + this->get_arrow_proxy().offset()
709 );
710 }
711
712 template <bool BIG>
713 auto list_view_array_impl<BIG>::make_list_sizes() -> offset_type*
714 {
715 return reinterpret_cast<offset_type*>(
716 this->get_arrow_proxy().buffers()[SIZES_BUFFER_INDEX].data() + this->get_arrow_proxy().offset()
717 );
718 }
719
720#ifdef __GNUC__
721# pragma GCC diagnostic pop
722#endif
723
724 /*****************************************
725 * fixed_sized_list_array implementation *
726 *****************************************/
727
728 inline auto fixed_sized_list_array::list_size_from_format(const std::string_view format) -> uint64_t
729 {
730 SPARROW_ASSERT(format.size() >= 3, "Invalid format string");
731 const auto n_digits = format.size() - 3;
732 const auto list_size_str = format.substr(3, n_digits);
733 return std::stoull(std::string(list_size_str));
734 }
735
737 : base_type(std::move(proxy))
738 , m_list_size(fixed_sized_list_array::list_size_from_format(this->get_arrow_proxy().format()))
739 {
740 }
741
742 inline auto fixed_sized_list_array::offset_range(size_type i) const -> std::pair<offset_type, offset_type>
743 {
744 const auto offset = i * m_list_size;
745 return std::make_pair(offset, offset + m_list_size);
746 }
747
748 template <validity_bitmap_input R, input_metadata_container METADATA_RANGE>
749 inline arrow_proxy fixed_sized_list_array::create_proxy(
750 std::uint64_t list_size,
751 array&& flat_values,
752 R&& validity_input,
753 std::optional<std::string_view> name,
754 std::optional<METADATA_RANGE> metadata
755 )
756 {
757 const auto size = flat_values.size() / static_cast<std::size_t>(list_size);
758 auto vbitmap = ensure_validity_bitmap(size, std::forward<R>(validity_input));
759
760 auto [flat_arr, flat_schema] = extract_arrow_structures(std::move(flat_values));
761
762 const auto null_count = vbitmap.null_count();
763
764 const repeat_view<bool> children_ownership{true, 1};
765
766 std::string format = "+w:" + std::to_string(list_size);
767 ArrowSchema schema = make_arrow_schema(
768 format,
769 std::move(name), // name
770 std::move(metadata), // metadata
771 std::nullopt, // flags,
772 new ArrowSchema*[1]{new ArrowSchema(std::move(flat_schema))}, // children
773 children_ownership, // children ownership
774 nullptr, // dictionary
775 true // dictionary ownership
776
777 );
778 std::vector<buffer<std::uint8_t>> arr_buffs = {vbitmap.extract_storage()};
779
780 ArrowArray arr = make_arrow_array(
781 static_cast<std::int64_t>(size), // length
782 static_cast<int64_t>(null_count),
783 0, // offset
784 std::move(arr_buffs),
785 new ArrowArray*[1]{new ArrowArray(std::move(flat_arr))}, // children
786 children_ownership, // children ownership
787 nullptr, // dictionary
788 true // dictionary ownership
789 );
790 return arrow_proxy{std::move(arr), std::move(schema)};
791 }
792}
typename base_type::const_bitmap_range const_bitmap_range
array_bitmap_base_impl & operator=(const array_bitmap_base_impl &)
typename base_type::iterator_tag iterator_tag
typename base_type::bitmap_const_reference bitmap_const_reference
typename base_type::bitmap_type bitmap_type
Base class defining common immutable interface for arrays with a bitmap.
Base class for array type erasure.
Dynamically typed array encapsulating an Arrow layout.
Definition array_api.hpp:39
Proxy class over ArrowArray and ArrowSchema.
Smart pointer behaving like a copiable std::unique_ptr.
Definition memory.hpp:127
storage_type extract_storage() noexcept
constexpr size_type null_count() const noexcept
fixed_sized_list_array & operator=(const self_type &)=default
inner_types::list_size_type list_size_type
array_inner_types< self_type > inner_types
fixed_sized_list_array(arrow_proxy proxy)
fixed_sized_list_array(ARGS &&... args)
list_array_crtp_base< self_type > base_type
fixed_sized_list_array self_type
fixed_sized_list_array & operator=(self_type &&)=default
fixed_sized_list_array(self_type &&)=default
typename base_type::size_type size_type
fixed_sized_list_array(const self_type &)=default
typename base_type::const_bitmap_range const_bitmap_range
const array_wrapper * raw_flat_array() const
list_array_crtp_base(self_type &&)=default
nullable< inner_const_reference, bitmap_const_reference > const_reference
typename inner_types::const_value_iterator const_value_iterator
typename base_type::bitmap_const_reference bitmap_const_reference
typename base_type::iterator_tag iterator_tag
list_array_crtp_base(arrow_proxy proxy)
array_wrapper * raw_flat_array()
typename inner_types::value_iterator value_iterator
list_array_crtp_base & operator=(const self_type &)
list_array_crtp_base & operator=(self_type &&)=default
typename base_type::bitmap_type bitmap_type
list_array_crtp_base< DERIVED > self_type
typename base_type::size_type size_type
array_inner_types< DERIVED > inner_types
list_array_crtp_base(const self_type &)
nullable< inner_value_type > value_type
array_bitmap_base< DERIVED > base_type
list_array_impl(self_type &&)=default
list_array_impl< BIG > self_type
std::conditional_t< BIG, const std::int64_t, const std::int32_t > offset_type
typename base_type::size_type size_type
list_array_impl & operator=(self_type &&)=default
list_array_impl(ARGS &&... args)
list_array_impl(const self_type &)
array_inner_types< self_type > inner_types
static auto offset_from_sizes(SIZES_RANGE &&sizes) -> offset_buffer_type
inner_types::list_size_type list_size_type
list_array_crtp_base< list_array_impl< BIG > > base_type
list_array_impl & operator=(const self_type &)
u8_buffer< std::remove_const_t< offset_type > > offset_buffer_type
list_array_impl(arrow_proxy proxy)
std::size_t size_type
list_view_array_impl & operator=(const self_type &)
typename base_type::size_type size_type
list_view_array_impl & operator=(self_type &&)=default
list_view_array_impl(self_type &&)=default
u8_buffer< std::remove_const_t< offset_type > > offset_buffer_type
list_view_array_impl(arrow_proxy proxy)
std::conditional_t< BIG, const std::int64_t, const std::int32_t > offset_type
array_inner_types< self_type > inner_types
list_array_crtp_base< list_view_array_impl< BIG > > base_type
list_view_array_impl(ARGS &&... args)
list_view_array_impl< BIG > self_type
list_view_array_impl(const self_type &)
inner_types::list_size_type list_size_type
u8_buffer< std::remove_const_t< list_size_type > > size_buffer_type
The nullable class models a value or a reference that can be "null", or missing, like values traditio...
Definition nullable.hpp:280
A view that repeats a value a given number of times.
This buffer class is use as storage buffer for all sparrow arrays.
Definition u8_buffer.hpp:75
#define SPARROW_ASSERT(expr__, message__)
sparrow::u8_buffer< OFFSET_TYPE > offset_buffer_from_sizes(SIZES_RANGE &&sizes)
constexpr std::size_t size(typelist< T... >={})
Definition mp_utils.hpp:107
constexpr bool excludes_copy_and_move_ctor_v
Definition mp_utils.hpp:507
ArrowSchema make_arrow_schema(F format, N name, std::optional< M > metadata, std::optional< std::unordered_set< ArrowFlag > > flags, ArrowSchema **children, const CHILDREN_OWNERSHIP &children_ownership, ArrowSchema *dictionary, bool dictionary_ownership)
Creates an ArrowSchema owned by a unique_ptr and holding the provided data.
constexpr bool is_list_view_array_v
Checks whether T is a list_view_array type.
list_array_impl< false > list_array
array_bitmap_base_impl< D, false > array_bitmap_base
Convenient typedef to be used as a crtp base class for arrays using an immutable validity buffer.
constexpr bool is_fixed_sized_list_array_v
Checks whether T is a fixed_sized_list_array type.
list_view_array_impl< true > big_list_view_array
std::pair< ArrowArray, ArrowSchema > extract_arrow_structures(A &&a)
Extracts the internal ArrowArrays and ArrowSchema structures from the given array or typed layout.
Definition array.hpp:91
constexpr bool is_big_list_array_v
Checks whether T is a big_list_array type.
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.
list_view_array_impl< false > list_view_array
dynamic_bitset< std::uint8_t > validity_bitmap
constexpr bool is_list_array_v
Checks whether T is a list_array type.
SPARROW_API cloning_ptr< array_wrapper > array_factory(arrow_proxy proxy)
list_array_impl< true > big_list_array
validity_bitmap ensure_validity_bitmap(std::size_t size, R &&validity_input)
constexpr bool is_big_list_view_array_v
Checks whether T is a big_list_view_array type.
data_type
Runtime identifier of arrow data types, usually associated with raw bytes with the associated value.
functor_index_iterator< detail::layout_value_functor< const array_type, inner_value_type > > const_value_iterator
functor_index_iterator< detail::layout_value_functor< array_type, inner_value_type > > value_iterator
std::conditional_t< BIG, std::uint64_t, std::uint32_t > list_size_type
functor_index_iterator< detail::layout_value_functor< const array_type, inner_value_type > > const_value_iterator
functor_index_iterator< detail::layout_value_functor< array_type, inner_value_type > > value_iterator
functor_index_iterator< detail::layout_value_functor< array_type, inner_value_type > > value_iterator
std::conditional_t< BIG, std::uint64_t, std::uint32_t > list_size_type
functor_index_iterator< detail::layout_value_functor< const array_type, inner_value_type > > const_value_iterator
Base class for array_inner_types specialization.
Traits class that must be specialized by array classes inheriting from array_crtp_base.