sparrow ..
Loading...
Searching...
No Matches
dictionary_encoded_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 mplied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#pragma once
16
17#include <optional>
18
19#include "sparrow/array_api.hpp"
35
36namespace sparrow
37{
44 template <class Layout, bool is_const>
46 {
47 public:
48
49 using layout_type = Layout;
50 using storage_type = std::conditional_t<is_const, const layout_type*, layout_type>;
51 using return_type = std::
52 conditional_t<is_const, typename layout_type::const_reference, typename layout_type::reference>;
53
57 constexpr layout_element_functor() = default;
58
64 constexpr explicit layout_element_functor(storage_type layout_)
65 : p_layout(layout_)
66 {
67 }
68
75 [[nodiscard]] constexpr return_type operator()(std::size_t i) const
76 {
77 return p_layout->operator[](i);
78 }
79
80 private:
81
83 storage_type p_layout;
84 };
85
91 template <std::integral IT>
92 class dictionary_encoded_array;
93
94 namespace detail
95 {
96 template <std::integral IT>
98 {
104 [[nodiscard]] static constexpr sparrow::data_type get() noexcept
105 {
107 }
108 };
109
115 template <std::integral IT>
117 {
123 [[nodiscard]] static constexpr bool get() noexcept
124 {
125 return true;
126 }
127 };
128 }
129
135 template <class T>
137
148 template <std::integral IT>
150 {
151 public:
152
154 using size_type = std::size_t;
155 using difference_type = std::ptrdiff_t;
156
158
162
165
167 using reverse_iterator = std::reverse_iterator<iterator>;
169 using const_reverse_iterator = std::reverse_iterator<const_iterator>;
170
172
179
185 constexpr dictionary_encoded_array(const self_type& other);
186
193 constexpr self_type& operator=(const self_type& other);
194
201
208 constexpr self_type& operator=(self_type&& other);
209
215 [[nodiscard]] constexpr std::optional<std::string_view> name() const;
216
222 [[nodiscard]] std::optional<key_value_view> metadata() const;
223
229 [[nodiscard]] constexpr size_type size() const;
230
236 [[nodiscard]] constexpr bool empty() const;
237
245
251 [[nodiscard]] constexpr iterator begin();
252
258 [[nodiscard]] constexpr iterator end();
259
265 [[nodiscard]] constexpr const_iterator begin() const;
266
272 [[nodiscard]] constexpr const_iterator end() const;
273
279 [[nodiscard]] constexpr const_iterator cbegin() const;
280
286 [[nodiscard]] constexpr const_iterator cend() const;
287
293 [[nodiscard]] constexpr reverse_iterator rbegin();
294
300 [[nodiscard]] constexpr reverse_iterator rend();
301
307 [[nodiscard]] constexpr const_reverse_iterator rbegin() const;
308
314 [[nodiscard]] constexpr const_reverse_iterator rend() const;
315
321 [[nodiscard]] constexpr const_reverse_iterator crbegin() const;
322
328 [[nodiscard]] constexpr const_reverse_iterator crend() const;
329
336
343
350 template <class... Args>
352 explicit dictionary_encoded_array(Args&&... args)
353 : dictionary_encoded_array(create_proxy(std::forward<Args>(args)...))
354 {
355 }
356
366 [[nodiscard]] constexpr self_type slice(size_type start, size_type end) const;
367
377 [[nodiscard]] constexpr self_type slice_view(size_type start, size_type end) const;
378
379 private:
380
393 template <
395 input_metadata_container METADATA_RANGE = std::vector<metadata_pair>>
396 [[nodiscard]] static auto create_proxy(
397 keys_buffer_type&& keys,
398 array&& values,
399 R&& bitmaps,
400 std::optional<std::string_view> name = std::nullopt,
401 std::optional<METADATA_RANGE> metadata = std::nullopt
402 ) -> arrow_proxy;
403
416 template <
418 input_metadata_container METADATA_RANGE = std::vector<metadata_pair>>
419 [[nodiscard]] static auto create_proxy(
420 keys_buffer_type&& keys,
421 array&& values,
422 bool nullable = true,
423 std::optional<std::string_view> name = std::nullopt,
424 std::optional<METADATA_RANGE> metadata = std::nullopt
425 ) -> arrow_proxy;
426
438 template <input_metadata_container METADATA_RANGE = std::vector<metadata_pair>>
439 [[nodiscard]] static auto create_proxy_impl(
440 keys_buffer_type&& keys,
441 array&& values,
442 std::optional<validity_bitmap> validity = std::nullopt,
443 std::optional<std::string_view> name = std::nullopt,
444 std::optional<METADATA_RANGE> metadata = std::nullopt
445 ) -> arrow_proxy;
446
460 template <
461 std::ranges::input_range KEY_RANGE,
463 input_metadata_container METADATA_RANGE = std::vector<metadata_pair>>
464 requires(
465 !std::same_as<KEY_RANGE, keys_buffer_type>
466 and std::same_as<IT, std::ranges::range_value_t<KEY_RANGE>>
467 )
468 [[nodiscard]] static arrow_proxy create_proxy(
469 KEY_RANGE&& keys,
470 array&& values,
471 R&& bitmaps = validity_bitmap{},
472 std::optional<std::string_view> name = std::nullopt,
473 std::optional<METADATA_RANGE> metadata = std::nullopt
474 )
475 {
476 keys_buffer_type keys_buffer(std::forward<KEY_RANGE>(keys));
477 return create_proxy(
478 std::move(keys_buffer),
479 std::forward<array>(values),
480 std::forward<R>(bitmaps),
481 std::move(name),
482 std::move(metadata)
483 );
484 }
485
497 template <
498 std::ranges::input_range NULLABLE_KEY_RANGE,
499 input_metadata_container METADATA_RANGE = std::vector<metadata_pair>>
500 requires std::is_same_v<std::ranges::range_value_t<NULLABLE_KEY_RANGE>, nullable<IT>>
501 static arrow_proxy create_proxy(
502 NULLABLE_KEY_RANGE&& nullable_keys,
503 array&& values,
504 std::optional<std::string_view> name = std::nullopt,
505 std::optional<METADATA_RANGE> metadata = std::nullopt
506 );
507
508 using keys_layout = primitive_array<IT>;
509 using values_layout = cloning_ptr<array_wrapper>;
515 [[nodiscard]] const inner_value_type& dummy_inner_value() const;
516
522 [[nodiscard]] const_reference dummy_const_reference() const;
523
530 [[nodiscard]] static constexpr keys_layout create_keys_layout(arrow_proxy& proxy);
531
538 [[nodiscard]] static values_layout create_values_layout(arrow_proxy& proxy);
539
545 [[nodiscard]] constexpr arrow_proxy& get_arrow_proxy();
546
552 [[nodiscard]] constexpr const arrow_proxy& get_arrow_proxy() const;
553
555 arrow_proxy m_proxy;
557 keys_layout m_keys_layout;
559 values_layout p_values_layout;
560
562 };
563
572 template <class IT>
573 constexpr bool operator==(const dictionary_encoded_array<IT>& lhs, const dictionary_encoded_array<IT>& rhs);
574
575 /*******************************************
576 * dictionary_encoded_array implementation *
577 *******************************************/
578
579 template <std::integral IT>
581 : m_proxy(std::move(proxy))
582 , m_keys_layout(create_keys_layout(m_proxy))
583 , p_values_layout(create_values_layout(m_proxy))
584 {
585 SPARROW_ASSERT_TRUE(data_type_is_integer(m_proxy.data_type()));
586 }
587
588 template <std::integral IT>
590 : m_proxy(rhs.m_proxy)
591 , m_keys_layout(create_keys_layout(m_proxy))
592 , p_values_layout(create_values_layout(m_proxy))
593 {
594 }
595
596 template <std::integral IT>
598 {
599 if (this != &rhs)
600 {
601 m_proxy = rhs.m_proxy;
602 m_keys_layout = create_keys_layout(m_proxy);
603 p_values_layout = create_values_layout(m_proxy);
604 }
605 return *this;
606 }
607
608 template <std::integral IT>
610 : m_proxy(std::move(rhs.m_proxy))
611 , m_keys_layout(create_keys_layout(m_proxy))
612 , p_values_layout(create_values_layout(m_proxy))
613 {
614 }
615
616 template <std::integral IT>
618 {
619 if (this != &rhs)
620 {
621 using std::swap;
622 swap(m_proxy, rhs.m_proxy);
623 m_keys_layout = create_keys_layout(m_proxy);
624 p_values_layout = create_values_layout(m_proxy);
625 }
626 return *this;
627 }
628
629 template <std::integral IT>
630 template <validity_bitmap_input VBI, input_metadata_container METADATA_RANGE>
631 auto dictionary_encoded_array<IT>::create_proxy(
632 keys_buffer_type&& keys,
633 array&& values,
634 VBI&& validity_input,
635 std::optional<std::string_view> name,
636 std::optional<METADATA_RANGE> metadata
637 ) -> arrow_proxy
638 {
639 const auto size = keys.size();
640 validity_bitmap vbitmap = ensure_validity_bitmap(size, std::forward<VBI>(validity_input));
641 return create_proxy_impl(
642 std::forward<keys_buffer_type>(keys),
643 std::forward<array>(values),
644 std::make_optional<validity_bitmap>(std::move(vbitmap)),
645 std::move(name),
646 std::move(metadata)
647 );
648 }
649
650 template <std::integral IT>
651 template <validity_bitmap_input VBI, input_metadata_container METADATA_RANGE>
652 auto dictionary_encoded_array<IT>::create_proxy(
653 keys_buffer_type&& keys,
654 array&& values,
655 bool nullable,
656 std::optional<std::string_view> name,
657 std::optional<METADATA_RANGE> metadata
658 ) -> arrow_proxy
659 {
660 const auto size = keys.size();
661 return create_proxy_impl(
662 std::forward<keys_buffer_type>(keys),
663 std::forward<array>(values),
664 nullable ? std::make_optional<validity_bitmap>(nullptr, size) : std::nullopt,
665 std::move(name),
666 std::move(metadata)
667 );
668 }
669
670 template <std::integral IT>
671 template <input_metadata_container METADATA_RANGE>
672 [[nodiscard]] arrow_proxy dictionary_encoded_array<IT>::create_proxy_impl(
673 keys_buffer_type&& keys,
674 array&& values,
675 std::optional<validity_bitmap> validity,
676 std::optional<std::string_view> name,
677 std::optional<METADATA_RANGE> metadata
678 )
679 {
680 const auto size = keys.size();
681 auto [value_array, value_schema] = extract_arrow_structures(std::move(values));
682 static const repeat_view<bool> children_ownership{true, 0};
683
684 const std::optional<std::unordered_set<sparrow::ArrowFlag>>
685 flags = validity.has_value()
686 ? std::make_optional<std::unordered_set<sparrow::ArrowFlag>>({ArrowFlag::NULLABLE})
687 : std::nullopt;
688
689 // create arrow schema and array
692 std::move(name), // name
693 std::move(metadata), // metadata
694 flags, // flags
695 nullptr, // children
696 children_ownership, // children_ownership
697 new ArrowSchema(std::move(value_schema)), // dictionary
698 true // dictionary ownership
699 );
700
701 const size_t null_count = validity.has_value() ? validity->null_count() : 0;
702
703 std::vector<buffer<uint8_t>> buffers(2);
704 buffers[0] = validity.has_value() ? std::move(*validity).extract_storage()
705 : buffer<uint8_t>{nullptr, 0};
706 buffers[1] = std::move(keys).extract_storage();
707 // create arrow array
709 static_cast<std::int64_t>(size), // length
710 static_cast<std::int64_t>(null_count), // Null count
711 0, // offset
712 std::move(buffers),
713 nullptr, // children
714 children_ownership, // children_ownership
715 new ArrowArray(std::move(value_array)), // dictionary
716 true // dictionary ownership
717 );
718 return arrow_proxy(std::move(arr), std::move(schema));
719 }
720
721 template <std::integral IT>
722 template <std::ranges::input_range NULLABLE_KEY_RANGE, input_metadata_container METADATA_RANGE>
723 requires std::is_same_v<std::ranges::range_value_t<NULLABLE_KEY_RANGE>, nullable<IT>>
724 arrow_proxy dictionary_encoded_array<IT>::create_proxy(
725 NULLABLE_KEY_RANGE&& nullable_keys,
726 array&& values,
727 std::optional<std::string_view> name,
728 std::optional<METADATA_RANGE> metadata
729 )
730 {
731 auto keys = nullable_keys
732 | std::views::transform(
733 [](const auto& v)
734 {
735 return v.get();
736 }
737 );
738 auto is_non_null = nullable_keys
739 | std::views::transform(
740 [](const auto& v)
741 {
742 return v.has_value();
743 }
744 );
745 return create_proxy(
746 std::move(keys),
747 std::forward<array>(values),
748 std::move(is_non_null),
749 std::move(name),
750 std::move(metadata)
751 );
752 }
753
754 template <std::integral IT>
755 constexpr std::optional<std::string_view> dictionary_encoded_array<IT>::name() const
756 {
757 return m_proxy.name();
758 }
759
760 template <std::integral IT>
761 std::optional<key_value_view> dictionary_encoded_array<IT>::metadata() const
762 {
763 return m_proxy.metadata();
764 }
765
766 template <std::integral IT>
768 {
769 return m_proxy.length();
770 }
771
772 template <std::integral IT>
773 constexpr auto dictionary_encoded_array<IT>::empty() const -> bool
774 {
775 return size() == 0;
776 }
777
778 template <std::integral IT>
780 {
782 const auto index = m_keys_layout[i];
783
784 if (index.has_value())
785 {
786 SPARROW_ASSERT_TRUE(index.value() >= 0);
787 return array_element(*p_values_layout, static_cast<std::size_t>(index.value()));
788 }
789 else
790 {
791 return dummy_const_reference();
792 }
793 }
794
795 template <std::integral IT>
797 {
798 return iterator(functor_type(this), 0u);
799 }
800
801 template <std::integral IT>
803 {
804 return iterator(functor_type(this), size());
805 }
806
807 template <std::integral IT>
809 {
810 return cbegin();
811 }
812
813 template <std::integral IT>
815 {
816 return cend();
817 }
818
819 template <std::integral IT>
821 {
822 return const_iterator(const_functor_type(this), 0u);
823 }
824
825 template <std::integral IT>
827 {
828 return const_iterator(const_functor_type(this), size());
829 }
830
831 template <std::integral IT>
833 {
834 return reverse_iterator(end());
835 }
836
837 template <std::integral IT>
838 [[nodiscard]] constexpr auto dictionary_encoded_array<IT>::rend() -> reverse_iterator
839 {
840 return reverse_iterator(begin());
841 }
842
843 template <std::integral IT>
844 [[nodiscard]] constexpr auto dictionary_encoded_array<IT>::rbegin() const -> const_reverse_iterator
845 {
847 }
848
849 template <std::integral IT>
850 [[nodiscard]] constexpr auto dictionary_encoded_array<IT>::rend() const -> const_reverse_iterator
851 {
853 }
854
855 template <std::integral IT>
856 [[nodiscard]] constexpr auto dictionary_encoded_array<IT>::crbegin() const -> const_reverse_iterator
857 {
858 return rbegin();
859 }
860
861 template <std::integral IT>
862 [[nodiscard]] constexpr auto dictionary_encoded_array<IT>::crend() const -> const_reverse_iterator
863 {
864 return rend();
865 }
866
867 template <std::integral IT>
873
874 template <std::integral IT>
880
881 template <std::integral IT>
882 auto dictionary_encoded_array<IT>::dummy_inner_value() const -> const inner_value_type&
883 {
884 static const inner_value_type instance = array_default_element_value(*p_values_layout);
885 return instance;
886 }
887
888 template <std::integral IT>
890 {
891 SPARROW_ASSERT_TRUE(start <= end);
892 return self_type{get_arrow_proxy().slice(start, end)};
893 }
894
895 template <std::integral IT>
897 {
898 SPARROW_ASSERT_TRUE(start <= end);
899 return self_type{get_arrow_proxy().slice_view(start, end)};
900 }
901
902 /*template <std::integral IT>
903 auto dictionary_encoded_array<IT>::dummy_inner_const_reference() const -> inner_const_reference
904 {
905 static const inner_const_reference instance =
906 std::visit([](const auto& val) -> inner_const_reference { return val; }, dummy_inner_value());
907 return instance;
908 }*/
909
910 template <std::integral IT>
911 auto dictionary_encoded_array<IT>::dummy_const_reference() const -> const_reference
912 {
913 static const const_reference instance = std::visit(
914 [](const auto& val) -> const_reference
915 {
916 using inner_ref = typename arrow_traits<std::decay_t<decltype(val)>>::const_reference;
917 return const_reference{nullable<inner_ref>(inner_ref(val), false)};
918 },
919 dummy_inner_value()
920 );
921 return instance;
922 }
923
924 template <std::integral IT>
925 typename dictionary_encoded_array<IT>::values_layout
926 dictionary_encoded_array<IT>::create_values_layout(arrow_proxy& proxy)
927 {
928 const auto& dictionary = proxy.dictionary();
929 SPARROW_ASSERT_TRUE(dictionary);
930 arrow_proxy ar_dictionary{&(dictionary->array()), &(dictionary->schema())};
931 return array_factory(std::move(ar_dictionary));
932 }
933
934 template <std::integral IT>
935 constexpr auto dictionary_encoded_array<IT>::create_keys_layout(arrow_proxy& proxy) -> keys_layout
936 {
937 return keys_layout{arrow_proxy{&proxy.array(), &proxy.schema()}};
938 }
939
940 template <std::integral IT>
941 constexpr auto dictionary_encoded_array<IT>::get_arrow_proxy() -> arrow_proxy&
942 {
943 return m_proxy;
944 }
945
946 template <std::integral IT>
947 constexpr auto dictionary_encoded_array<IT>::get_arrow_proxy() const -> const arrow_proxy&
948 {
949 return m_proxy;
950 }
951
952 template <class IT>
954 {
955 return std::ranges::equal(lhs, rhs);
956 }
957}
958
959#if defined(__cpp_lib_format)
960template <std::integral IT>
961struct std::formatter<sparrow::dictionary_encoded_array<IT>>
962{
963 constexpr auto parse(std::format_parse_context& ctx)
964 {
965 return ctx.begin(); // Simple implementation
966 }
967
968 auto format(const sparrow::dictionary_encoded_array<IT>& ar, std::format_context& ctx) const
969 {
970 std::format_to(ctx.out(), "Dictionary [size={}] <", ar.size());
971 std::for_each(
972 ar.cbegin(),
973 std::prev(ar.cend()),
974 [&ctx](const auto& value)
975 {
976 std::format_to(ctx.out(), "{}, ", value);
977 }
978 );
979 std::format_to(ctx.out(), "{}>", ar.back());
980 return ctx.out();
981 }
982};
983
984namespace sparrow
985{
986 template <std::integral IT>
987 std::ostream& operator<<(std::ostream& os, const dictionary_encoded_array<IT>& value)
988 {
989 os << std::format("{}", value);
990 return os;
991 }
992}
993
994#endif
Dynamically typed array encapsulating an Arrow layout.
Definition array_api.hpp:41
Object that owns a piece of contiguous memory.
Definition buffer.hpp:113
Forward declaration of dictionary_encoded_array.
constexpr iterator begin()
Gets an iterator to the beginning of the array.
functor_index_iterator< const_functor_type > const_iterator
SPARROW_CONSTEXPR_CLANG const_reference operator[](size_type i) const
Access operator for getting element at index.
constexpr self_type & operator=(const self_type &other)
Copy assignment operator.
constexpr const_reverse_iterator crbegin() const
Gets a constant reverse iterator to the beginning of the array.
constexpr self_type & operator=(self_type &&other)
Move assignment operator.
SPARROW_CONSTEXPR_CLANG const_reference back() const
Gets a reference to the last element.
std::optional< key_value_view > metadata() const
Gets the metadata of the array.
constexpr self_type slice_view(size_type start, size_type end) const
Slices the array to keep only the elements between the given start and end.
layout_element_functor< self_type, true > functor_type
constexpr const_reverse_iterator rend() const
Gets a constant reverse iterator to the end of the array.
constexpr const_reverse_iterator crend() const
Gets a constant reverse iterator to the end of the array.
constexpr self_type slice(size_type start, size_type end) const
Slices the array to keep only the elements between the given start and end.
constexpr iterator end()
Gets an iterator to the end of the array.
constexpr const_iterator cend() const
Gets a constant iterator to the end of the array.
dictionary_encoded_array(arrow_proxy proxy)
Constructs a dictionary encoded array from an arrow proxy.
constexpr const_iterator cbegin() const
Gets a constant iterator to the beginning of the array.
layout_element_functor< self_type, true > const_functor_type
constexpr reverse_iterator rend()
Gets a reverse iterator to the end of the array.
dictionary_encoded_array(Args &&... args)
Constructs a dictionary encoded array with the given arguments.
constexpr const_iterator begin() const
Gets a constant iterator to the beginning of the array.
constexpr const_reverse_iterator rbegin() const
Gets a constant reverse iterator to the beginning of the array.
SPARROW_CONSTEXPR_CLANG const_reference front() const
Gets a reference to the first element.
constexpr std::optional< std::string_view > name() const
Gets the name of the array.
constexpr bool empty() const
Checks if the array is empty.
constexpr dictionary_encoded_array(self_type &&other)
Move constructor.
constexpr size_type size() const
Gets the number of elements in the array.
constexpr const_iterator end() const
Gets a constant iterator to the end of the array.
constexpr reverse_iterator rbegin()
Gets a reverse iterator to the beginning of the array.
functor_index_iterator< functor_type > iterator
constexpr dictionary_encoded_array(const self_type &other)
Copy constructor.
std::reverse_iterator< const_iterator > const_reverse_iterator
Functor for accessing elements in a layout.
constexpr layout_element_functor(storage_type layout_)
Constructs a functor with the given layout.
std:: conditional_t< is_const, typename layout_type::const_reference, typename layout_type::reference > return_type
constexpr layout_element_functor()=default
Default constructor.
std::conditional_t< is_const, const layout_type *, layout_type > storage_type
constexpr return_type operator()(std::size_t i) const
Access operator for getting element at index.
A view that repeats a value a given number of times.
This buffer class is used as storage buffer for all sparrow arrays.
Concept for input containers that can provide metadata pairs.
Definition metadata.hpp:304
Concept defining valid input types for validity bitmap creation.
#define SPARROW_CONSTEXPR_CLANG
Definition config.hpp:64
#define SPARROW_ASSERT_TRUE(expr__)
#define SPARROW_ASSERT_FALSE(expr__)
constexpr bool excludes_copy_and_move_ctor_v
Convenience variable template for excludes_copy_and_move_ctor.
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 std::string_view data_type_to_format(data_type type)
SPARROW_API bool operator==(const array &lhs, const array &rhs)
Compares the content of two arrays.
constexpr bool is_dictionary_encoded_array_v
Checks whether T is a dictionary_encoded_array type.
SPARROW_API void swap(ArrowArray &lhs, ArrowArray &rhs)
Swaps the contents of the two ArrowArray objects.
SPARROW_API array_traits::inner_value_type array_default_element_value(const array_wrapper &ar)
std::pair< ArrowArray, ArrowSchema > extract_arrow_structures(A &&a)
Extracts the internal ArrowArray and ArrowSchema structures from the given array or typed layout.
Definition array.hpp:98
primitive_array_impl< T > primitive_array
Array of values of whose type has fixed binary size.
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.
dynamic_bitset< std::uint8_t > validity_bitmap
Type alias for a validity bitmap using 8-bit storage blocks.
std::ostream & operator<<(std::ostream &os, const nullval_t &)
SPARROW_API cloning_ptr< array_wrapper > array_factory(arrow_proxy proxy)
SPARROW_API array_traits::const_reference array_element(const array_wrapper &ar, std::size_t index)
validity_bitmap ensure_validity_bitmap(std::size_t size, R &&validity_input)
Ensures a validity bitmap of the specified size from various input types.
constexpr bool data_type_is_integer(data_type dt) noexcept
data_type
Runtime identifier of arrow data types, usually associated with raw bytes with the associated value.
mpl::rename< mpl::unique< mpl::transform< detail::array_const_reference_t, all_base_types_t > >, nullable_variant > const_reference
mpl::rename< all_base_types_t, std::variant > inner_value_type
mpl::rename< mpl::transform< detail::array_value_type_t, all_base_types_t >, nullable_variant > value_type
Provides compile-time information about Arrow data types.
static constexpr sparrow::data_type get() noexcept
Gets the data type for the dictionary keys.
Metafunction for retrieving the data_type of a typed array.
static constexpr bool get() noexcept
Returns true for dictionary_encoded_array types.
static constexpr bool get() noexcept