sparrow 2.0.0
C++20 idiomatic APIs for the Apache Arrow Columnar Format
Loading...
Searching...
No Matches
fixed_width_binary_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 <cstddef>
18#include <cstdint>
19#include <iterator>
20#include <optional>
21#include <ranges>
22#include <string>
23#include <type_traits>
24#include <vector>
25
41
42namespace sparrow
43{
44 template <std::ranges::sized_range T, typename CR, typename Ext = empty_extension>
46
48
79 fixed_width_binary_traits::value_type,
80 fixed_width_binary_traits::const_reference>;
81
82 template <std::ranges::sized_range T, typename CR, typename Ext>
109
110 namespace detail
111 {
112 template <>
114 {
115 [[nodiscard]] static constexpr sparrow::data_type get()
116 {
118 }
119 };
120 }
121
122 template <std::ranges::sized_range T, class CR, class Ext>
124 : public mutable_array_bitmap_base<fixed_width_binary_array_impl<T, CR, Ext>>,
125 public Ext
126 {
127 private:
128
129 static_assert(
130 sizeof(std::ranges::range_value_t<T>) == sizeof(byte_t),
131 "Only sequences of types with the same size as byte_t are supported"
132 );
133
134 public:
135
138
140 using inner_value_type = typename inner_types::inner_value_type;
141 using inner_reference = typename inner_types::inner_reference;
142 using inner_const_reference = typename inner_types::inner_const_reference;
143
145 using bitmap_reference = typename base_type::bitmap_reference;
148
152
156 using data_iterator = typename inner_types::data_iterator;
157
158 using const_data_iterator = typename inner_types::const_data_iterator;
159 using data_value_type = typename inner_types::data_value_type;
160
161 using value_iterator = typename inner_types::value_iterator;
162 using const_value_iterator = typename inner_types::const_value_iterator;
163
164 using functor_type = typename inner_types::functor_type;
165 using const_functor_type = typename inner_types::const_functor_type;
166
181
197 template <class... ARGS>
200 : base_type(create_proxy(std::forward<ARGS>(args)...))
201 , m_element_size(num_bytes_for_fixed_sized_binary(this->get_arrow_proxy().format()))
202 {
203 }
204
205 using base_type::get_arrow_proxy;
206 using base_type::size;
207
219 [[nodiscard]] constexpr inner_reference value(size_type i);
220
232 [[nodiscard]] constexpr inner_const_reference value(size_type i) const;
233
234 private:
235
257 template <
260 input_metadata_container METADATA_RANGE = std::vector<metadata_pair>>
261 [[nodiscard]] static arrow_proxy create_proxy(
262 u8_buffer<C>&& data_buffer,
263 size_t element_count,
264 size_t element_size,
266 std::optional<std::string_view> name = std::nullopt,
267 std::optional<METADATA_RANGE> metadata = std::nullopt
268 );
269
285 template <input_metadata_container METADATA_RANGE = std::vector<metadata_pair>>
286 [[nodiscard]] static arrow_proxy create_proxy(
287 size_t element_size,
288 bool nullable = true,
289 std::optional<std::string_view> name = std::nullopt,
290 std::optional<METADATA_RANGE> metadata = std::nullopt
291 );
292
313 template <
314 std::ranges::input_range VALUES,
316 input_metadata_container METADATA_RANGE = std::vector<metadata_pair>>
317 requires(
318 std::ranges::input_range<std::ranges::range_value_t<VALUES>>
320 )
321 [[nodiscard]] static arrow_proxy create_proxy(
322 VALUES&& values,
323 VB&& validity_input,
324 std::optional<std::string_view> name = std::nullopt,
325 std::optional<METADATA_RANGE> metadata = std::nullopt
326 );
327
347 template <std::ranges::input_range VALUES, input_metadata_container METADATA_RANGE = std::vector<metadata_pair>>
348 requires(
349 std::ranges::input_range<std::ranges::range_value_t<VALUES>>
351 )
352 [[nodiscard]] static arrow_proxy create_proxy(
353 VALUES&& values,
354 bool nullable = true,
355 std::optional<std::string_view> name = std::nullopt,
356 std::optional<METADATA_RANGE> metadata = std::nullopt
357 );
358
376 template <std::ranges::input_range NULLABLE_VALUES, input_metadata_container METADATA_RANGE = std::vector<metadata_pair>>
378 && std::ranges::input_range<typename std::ranges::range_value_t<NULLABLE_VALUES>::value_type>
379 && std::is_same_v<
380 std::ranges::range_value_t<typename std::ranges::range_value_t<NULLABLE_VALUES>::value_type>,
381 byte_t>
382 [[nodiscard]] static arrow_proxy create_proxy(
383 NULLABLE_VALUES&&,
384 std::optional<std::string_view> name = std::nullopt,
385 std::optional<METADATA_RANGE> metadata = std::nullopt
386 );
387
411 template <mpl::char_like C, input_metadata_container METADATA_RANGE = std::vector<metadata_pair>>
412 [[nodiscard]] static arrow_proxy create_proxy_impl(
413 u8_buffer<C>&& data_buffer,
414 size_t element_count,
415 size_t element_size,
416 std::optional<validity_bitmap>&& validity_input,
417 std::optional<std::string_view> name = std::nullopt,
418 std::optional<METADATA_RANGE> metadata = std::nullopt
419 );
420
421 static constexpr size_t DATA_BUFFER_INDEX = 1;
422
431 [[nodiscard]] constexpr size_type byte_offset(size_type index) const
432 {
433 return (index + static_cast<size_type>(this->get_arrow_proxy().offset())) * m_element_size;
434 }
435
443 [[nodiscard]] constexpr auto& get_data_buffer()
444 {
445 return this->get_arrow_proxy().get_array_private_data()->buffers()[DATA_BUFFER_INDEX];
446 }
447
455 [[nodiscard]] constexpr const auto& get_data_buffer() const
456 {
457 return this->get_arrow_proxy().buffers()[DATA_BUFFER_INDEX];
458 }
459
471 [[nodiscard]] constexpr data_iterator data(size_type i);
472
480 [[nodiscard]] constexpr value_iterator value_begin();
481
489 [[nodiscard]] constexpr value_iterator value_end();
490
498 [[nodiscard]] constexpr const_value_iterator value_cbegin() const;
499
507 [[nodiscard]] constexpr const_value_iterator value_cend() const;
508
520 [[nodiscard]] constexpr const_data_iterator data(size_type i) const;
521
522 // Modifiers
523
540 template <std::ranges::sized_range U>
541 requires mpl::convertible_ranges<U, T>
542 constexpr void resize_values(size_type new_length, U value);
543
563 template <std::ranges::sized_range U>
564 requires mpl::convertible_ranges<U, T>
565 constexpr value_iterator insert_value(const_value_iterator pos, U value, size_type count);
566
592 template <typename InputIt>
593 requires std::input_iterator<InputIt>
594 && mpl::convertible_ranges<typename std::iterator_traits<InputIt>::value_type, T>
595 constexpr value_iterator insert_values(const_value_iterator pos, InputIt first, InputIt last);
596
615 constexpr value_iterator erase_values(const_value_iterator pos, size_type count);
616
633 template <std::ranges::sized_range U>
634 requires mpl::convertible_ranges<U, T>
635 constexpr void assign(U&& rhs, size_type index);
636
637 size_t m_element_size = 0;
638
641 friend base_type;
644 };
645
646 /************************************************
647 * fixed_width_binary_array_impl implementation *
648 ************************************************/
649
650 template <std::ranges::sized_range T, typename CR, typename Ext>
652 : base_type(std::move(proxy))
653 , m_element_size(num_bytes_for_fixed_sized_binary(this->get_arrow_proxy().format()))
654 {
655 SPARROW_ASSERT_TRUE(this->get_arrow_proxy().data_type() == data_type::FIXED_WIDTH_BINARY);
656 }
657
658 template <std::ranges::sized_range T, typename CR, typename Ext>
659 template <mpl::char_like C, validity_bitmap_input VB, input_metadata_container METADATA_RANGE>
660 arrow_proxy fixed_width_binary_array_impl<T, CR, Ext>::create_proxy(
661 u8_buffer<C>&& data_buffer,
662 size_t element_count,
663 size_t element_size,
664 VB&& validity_input,
665 std::optional<std::string_view> name,
666 std::optional<METADATA_RANGE> metadata
667 )
668 {
669 validity_bitmap bitmap = ensure_validity_bitmap(element_count, std::forward<VB>(validity_input));
670 return create_proxy_impl(
671 std::move(data_buffer),
672 element_count,
673 element_size,
674 std::move(bitmap),
675 std::move(name),
676 std::move(metadata)
677 );
678 }
679
680 template <std::ranges::sized_range T, typename CR, typename Ext>
681 template <input_metadata_container METADATA_RANGE>
682 arrow_proxy fixed_width_binary_array_impl<T, CR, Ext>::create_proxy(
683 size_t element_size,
684 bool nullable,
685 std::optional<std::string_view> name,
686 std::optional<METADATA_RANGE> metadata
687 )
688 {
689 u8_buffer<char> data_buffer{};
690 std::optional<validity_bitmap> bitmap = nullable ? std::make_optional<validity_bitmap>(
691 nullptr,
692 0,
694 )
695 : std::nullopt;
696 return create_proxy_impl(
697 std::move(data_buffer),
698 0,
699 element_size,
700 std::move(bitmap),
701 std::move(name),
702 std::move(metadata)
703 );
704 }
705
706 template <std::ranges::sized_range T, typename CR, typename Ext>
707 template <std::ranges::input_range R, validity_bitmap_input VB, input_metadata_container METADATA_RANGE>
708 requires(
709 std::ranges::input_range<std::ranges::range_value_t<R>> && // a range of ranges
711 // range of char-like
712 )
713 arrow_proxy fixed_width_binary_array_impl<T, CR, Ext>::create_proxy(
714 R&& values,
715 VB&& validity_input,
716 std::optional<std::string_view> name,
717 std::optional<METADATA_RANGE> metadata
718 )
719 {
720 using values_type = std::ranges::range_value_t<R>;
721 using values_inner_value_type = std::ranges::range_value_t<values_type>;
722
724 const size_t element_size = std::ranges::empty(values) ? 0 : std::ranges::size(*values.begin());
725
726 auto data_buffer = u8_buffer<values_inner_value_type>(std::ranges::views::join(values));
727 return create_proxy(
728 std::move(data_buffer),
729 values.size(),
730 element_size,
731 std::forward<VB>(validity_input),
732 std::forward<std::optional<std::string_view>>(name),
733 std::forward<std::optional<METADATA_RANGE>>(metadata)
734 );
735 }
736
737 template <std::ranges::sized_range T, typename CR, typename Ext>
738 template <std::ranges::input_range R, input_metadata_container METADATA_RANGE>
739 requires(
740 std::ranges::input_range<std::ranges::range_value_t<R>> && // a range of ranges
742 // range of char-like
743 )
744 arrow_proxy fixed_width_binary_array_impl<T, CR, Ext>::create_proxy(
745 R&& values,
746 bool nullable,
747 std::optional<std::string_view> name,
748 std::optional<METADATA_RANGE> metadata
749 )
750 {
751 if (nullable)
752 {
753 return create_proxy(
754 std::forward<R>(values),
756 std::move(name),
757 std::move(metadata)
758 );
759 }
760 else
761 {
762 using values_type = std::ranges::range_value_t<R>;
763 using values_inner_value_type = std::ranges::range_value_t<values_type>;
764
766 const size_t element_size = std::ranges::empty(values) ? 0 : std::ranges::size(*values.begin());
767 auto data_buffer = u8_buffer<values_inner_value_type>(std::ranges::views::join(values));
768 return create_proxy_impl(
769 std::move(data_buffer),
770 values.size(), // element count
771 element_size,
772 std::nullopt, // validity bitmap
773 std::move(name),
774 std::move(metadata)
775 );
776 }
777 }
778
779 template <std::ranges::sized_range T, typename CR, typename Ext>
780 template <std::ranges::input_range NULLABLE_RANGE, input_metadata_container METADATA_RANGE>
782 && std::ranges::input_range<typename std::ranges::range_value_t<NULLABLE_RANGE>::value_type>
783 && std::is_same_v<
784 std::ranges::range_value_t<typename std::ranges::range_value_t<NULLABLE_RANGE>::value_type>,
785 byte_t>
786 arrow_proxy fixed_width_binary_array_impl<T, CR, Ext>::create_proxy(
787 NULLABLE_RANGE&& range,
788 std::optional<std::string_view> name,
789 std::optional<METADATA_RANGE> metadata
790 )
791 {
792 // split into values and is_non_null ranges
793 const auto values = range
794 | std::views::transform(
795 [](const auto& v)
796 {
797 return v.get();
798 }
799 );
800 const auto is_non_null = range
801 | std::views::transform(
802 [](const auto& v)
803 {
804 return v.has_value();
805 }
806 );
807 return self_type::create_proxy(values, is_non_null, std::move(name), std::move(metadata));
808 }
809
810 template <std::ranges::sized_range T, typename CR, typename Ext>
811 template <mpl::char_like C, input_metadata_container METADATA_RANGE>
812 arrow_proxy fixed_width_binary_array_impl<T, CR, Ext>::create_proxy_impl(
813 u8_buffer<C>&& data_buffer,
814 size_t element_count,
815 size_t element_size,
816 std::optional<validity_bitmap>&& bitmap,
817 std::optional<std::string_view> name,
818 std::optional<METADATA_RANGE> metadata
819 )
820 {
822 element_size == 0 ? (data_buffer.size() == 0) : (data_buffer.size() % element_size == 0)
823 );
824
825 const auto null_count = bitmap.has_value() ? bitmap->null_count() : 0;
826 std::string format_str = "w:" + std::to_string(element_size);
827 const std::optional<std::unordered_set<ArrowFlag>>
828 flags = bitmap.has_value()
829 ? std::make_optional<std::unordered_set<ArrowFlag>>({ArrowFlag::NULLABLE})
830 : std::nullopt;
831
833 std::move(format_str),
834 std::move(name), // name
835 std::move(metadata), // metadata
836 flags, // flags,
837 nullptr, // children
838 repeat_view<bool>(true, 0), // children_ownership
839 nullptr, // dictionary
840 true // dictionary ownership
841
842 );
843 std::vector<buffer<std::uint8_t>> arr_buffs = {
844 bitmap.has_value() ? std::move(*bitmap).extract_storage()
845 : buffer<std::uint8_t>{nullptr, 0, validity_bitmap::default_allocator()},
846 std::move(data_buffer).extract_storage()
847 };
848
849 ArrowArray arr = make_arrow_array(
850 static_cast<std::int64_t>(element_count), // length
851 static_cast<int64_t>(null_count),
852 0, // offset
853 std::move(arr_buffs),
854 nullptr, // children
855 repeat_view<bool>(true, 0), // children_ownership
856 nullptr, // dictionary
857 true // dictionary ownership
858 );
859 arrow_proxy proxy{std::move(arr), std::move(schema)};
860 Ext::init(proxy);
861 return proxy;
862 }
863
864 template <std::ranges::sized_range T, typename CR, typename Ext>
865 constexpr auto fixed_width_binary_array_impl<T, CR, Ext>::data(size_type i) -> data_iterator
866 {
867 return const_cast<data_iterator>(std::as_const(*this).data(i));
868 }
869
870 template <std::ranges::sized_range T, typename CR, typename Ext>
871 constexpr auto fixed_width_binary_array_impl<T, CR, Ext>::data(size_type i) const -> const_data_iterator
872 {
873 const auto& data_buffer = get_data_buffer();
874 const size_t data_buffer_size = data_buffer.size();
875 const size_type index_offset = (static_cast<size_type>(this->get_arrow_proxy().offset())
876 * m_element_size)
877 + i;
878 SPARROW_ASSERT_TRUE(data_buffer_size >= index_offset);
879 return data_buffer.template data<const data_value_type>() + index_offset;
880 }
881
882 template <std::ranges::sized_range T, typename CR, typename Ext>
883 template <std::ranges::sized_range U>
885 constexpr void fixed_width_binary_array_impl<T, CR, Ext>::assign(U&& rhs, size_type index)
886 {
887 SPARROW_ASSERT_TRUE(std::ranges::size(rhs) == m_element_size);
888 SPARROW_ASSERT_TRUE(index < size());
889 std::copy(std::ranges::begin(rhs), std::ranges::end(rhs), data(index * m_element_size));
890 }
891
892 template <std::ranges::sized_range T, typename CR, typename Ext>
894 {
895 SPARROW_ASSERT_TRUE(i < size());
896 return inner_reference(this, i);
897 }
898
899 template <std::ranges::sized_range T, typename CR, typename Ext>
901 {
902 SPARROW_ASSERT_TRUE(i < this->size());
903 const auto offset_begin = i * m_element_size;
904 const auto offset_end = offset_begin + m_element_size;
905 const const_data_iterator pointer_begin = data(static_cast<size_type>(offset_begin));
906 const const_data_iterator pointer_end = data(static_cast<size_type>(offset_end));
907 return inner_const_reference(pointer_begin, pointer_end);
908 }
909
910 template <std::ranges::sized_range T, typename CR, typename Ext>
911 constexpr auto fixed_width_binary_array_impl<T, CR, Ext>::value_begin() -> value_iterator
912 {
913 return value_iterator{functor_type{&(this->derived_cast())}, 0};
914 }
915
916 template <std::ranges::sized_range T, typename CR, typename Ext>
917 constexpr auto fixed_width_binary_array_impl<T, CR, Ext>::value_end() -> value_iterator
918 {
919 return sparrow::next(value_begin(), size());
920 }
921
922 template <std::ranges::sized_range T, typename CR, typename Ext>
923 constexpr auto fixed_width_binary_array_impl<T, CR, Ext>::value_cbegin() const -> const_value_iterator
924 {
925 return const_value_iterator{const_functor_type{&(this->derived_cast())}, 0};
926 }
927
928 template <std::ranges::sized_range T, typename CR, typename Ext>
929 constexpr auto fixed_width_binary_array_impl<T, CR, Ext>::value_cend() const -> const_value_iterator
930 {
931 return sparrow::next(value_cbegin(), this->size());
932 }
933
934 template <std::ranges::sized_range T, typename CR, typename Ext>
935 template <std::ranges::sized_range U>
937 constexpr void fixed_width_binary_array_impl<T, CR, Ext>::resize_values(size_type new_length, U value)
938 {
939 SPARROW_ASSERT_TRUE(m_element_size == value.size());
940 if (new_length < size())
941 {
942 const size_t new_size = new_length + static_cast<size_t>(this->get_arrow_proxy().offset());
943 const auto offset = new_size * m_element_size;
944 auto& data_buffer = get_data_buffer();
945 data_buffer.resize(offset);
946 }
947 else if (new_length > size())
948 {
949 insert_value(value_cend(), value, new_length - size());
950 }
951 }
952
953 template <std::ranges::sized_range T, typename CR, typename Ext>
954 template <std::ranges::sized_range U>
956 constexpr auto
957 fixed_width_binary_array_impl<T, CR, Ext>::insert_value(const_value_iterator pos, U value, size_type count)
959 {
960 SPARROW_ASSERT_TRUE(m_element_size == value.size());
961 const auto idx = static_cast<size_t>(std::distance(value_cbegin(), pos));
962
963 const uint8_t* uint8_ptr = reinterpret_cast<const uint8_t*>(value.data());
964 const std::vector<uint8_t> casted_value(uint8_ptr, uint8_ptr + value.size());
965 const repeat_view<std::vector<uint8_t>> my_repeat_view{casted_value, count};
966 const auto joined_repeated_value_range = std::ranges::views::join(my_repeat_view);
967 auto& data_buffer = get_data_buffer();
968 const auto offset_begin = byte_offset(idx);
969 const auto pos_to_insert = sparrow::next(data_buffer.cbegin(), offset_begin);
970 data_buffer.insert(pos_to_insert, joined_repeated_value_range.begin(), joined_repeated_value_range.end());
971 return sparrow::next(value_begin(), idx);
972 }
973
974 template <std::ranges::sized_range T, typename CR, typename Ext>
975 template <typename InputIt>
976 requires std::input_iterator<InputIt>
978 constexpr auto
979 fixed_width_binary_array_impl<T, CR, Ext>::insert_values(const_value_iterator pos, InputIt first, InputIt last)
981 {
982 SPARROW_ASSERT_TRUE(value_cbegin() <= pos)
983 SPARROW_ASSERT_TRUE(pos <= value_cend());
984 SPARROW_ASSERT_TRUE(first <= last);
985 SPARROW_ASSERT_TRUE(all_same_size(std::ranges::subrange(first, last)));
986 SPARROW_ASSERT_TRUE(m_element_size == std::ranges::size(*first));
987
988 auto values = std::ranges::subrange(first, last);
989 const size_t cumulative_sizes = values.size() * m_element_size;
990 auto& data_buffer = get_data_buffer();
991 data_buffer.resize(data_buffer.size() + cumulative_sizes);
992 const auto idx = static_cast<size_t>(std::distance(value_cbegin(), pos));
993 sequence_view<byte_t> casted_values{reinterpret_cast<byte_t*>(data_buffer.data()), data_buffer.size()};
994 const auto offset_begin = byte_offset(idx);
995 auto insert_pos = sparrow::next(casted_values.begin(), offset_begin);
996
997 // Move elements to make space for the new value
998 std::move_backward(
999 insert_pos,
1000 sparrow::next(casted_values.end(), -static_cast<difference_type>(cumulative_sizes)),
1001 casted_values.end()
1002 );
1003
1004 for (const auto& val : values)
1005 {
1006 std::copy(val.begin(), val.end(), insert_pos);
1007 std::advance(insert_pos, m_element_size);
1008 }
1009 return sparrow::next(value_begin(), idx);
1010 }
1011
1012 template <std::ranges::sized_range T, typename CR, typename Ext>
1013 constexpr auto
1014 fixed_width_binary_array_impl<T, CR, Ext>::erase_values(const_value_iterator pos, size_type count)
1015 -> value_iterator
1016 {
1017 SPARROW_ASSERT_TRUE(pos >= value_cbegin());
1018 SPARROW_ASSERT_TRUE(pos <= value_cend());
1019 const size_t index = static_cast<size_t>(std::distance(value_cbegin(), pos));
1020 if (count == 0)
1021 {
1022 return sparrow::next(value_begin(), index);
1023 }
1024 auto& data_buffer = get_data_buffer();
1025 const size_type byte_count = m_element_size * count;
1026 const auto offset_begin = byte_offset(index);
1027 const auto offset_end = offset_begin + byte_count;
1028 // move the values after the erased ones
1029 std::move(
1030 data_buffer.begin() + static_cast<difference_type>(offset_end),
1031 data_buffer.end(),
1032 data_buffer.begin() + static_cast<difference_type>(offset_begin)
1033 );
1034 data_buffer.resize(data_buffer.size() - byte_count);
1035 return sparrow::next(value_begin(), index);
1036 }
1037}
typename base_type::const_bitmap_range const_bitmap_range
typename base_type::iterator_tag iterator_tag
std::conditional_t< is_mutable, mutable_array_base< D >, array_crtp_base< D > > base_type
typename base_type::bitmap_const_reference bitmap_const_reference
typename base_type::bitmap_type bitmap_type
typename base_type::difference_type difference_type
bitset_iterator< self_type, true > const_iterator
typename storage_type::default_allocator default_allocator
fixed_width_binary_array_impl(arrow_proxy)
Constructs fixed-width binary array from Arrow proxy.
constexpr inner_reference value(size_type i)
Gets mutable reference to element at specified index.
fixed_width_binary_array_impl(ARGS &&... args)
Generic constructor for creating fixed-width binary array.
constexpr inner_const_reference value(size_type i) const
Gets const reference to element at specified index.
A view that repeats a value a given number of times.
The class sequence_view describes an object that can refer to a constant contiguous sequence of T wit...
This buffer class is used as storage buffer for all sparrow arrays.
Concept for input containers that can provide metadata pairs.
Definition metadata.hpp:332
Concept for character-like types.
Concept for convertible range types.
Definition mp_utils.hpp:931
Concept defining valid input types for validity bitmap creation.
#define SPARROW_ASSERT_TRUE(expr__)
constexpr std::size_t size(typelist< T... >={})
Gets the count of types contained in a typelist.
Definition mp_utils.hpp:216
constexpr bool excludes_copy_and_move_ctor_v
Convenience variable template for excludes_copy_and_move_ctor.
constexpr bool is_type_instance_of_v
Variable template for convenient access to is_type_instance_of.
Definition mp_utils.hpp:102
array_bitmap_base_impl< D, true > mutable_array_bitmap_base
Convenient alias for arrays with mutable validity bitmaps.
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.
std::byte byte_t
constexpr bool all_same_size(const Range &range)
Definition ranges.hpp:49
arrow_traits< std::vector< byte_t > > fixed_width_binary_traits
constexpr InputIt next(InputIt it, Distance n)
Definition iterator.hpp:503
fixed_width_binary_array_impl< fixed_width_binary_traits::value_type, fixed_width_binary_traits::const_reference > fixed_width_binary_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.
dynamic_bitset< std::uint8_t > validity_bitmap
Type alias for a validity bitmap using 8-bit storage blocks.
SPARROW_API std::size_t num_bytes_for_fixed_sized_binary(std::string_view format)
Get the number of bytes for a fixed width binary layout from the ArrowArray format string.
validity_bitmap ensure_validity_bitmap(std::size_t size, R &&validity_input)
Ensures a validity bitmap of the specified size from various input types.
data_type
Runtime identifier of arrow data types, usually associated with raw bytes with the associated value.
Extensions to the C++ standard library.
detail::layout_value_functor< array_type, inner_reference > functor_type
detail::layout_value_functor< const array_type, inner_const_reference > const_functor_type
Base class for array_inner_types specializations.
Traits class that must be specialized by array implementations.
Provides compile-time information about Arrow data types.
Metafunction for retrieving the data_type of a typed array.