87 [[nodiscard]]
reference dereference() const;
134 [[nodiscard]]
bool equal(const
self_type& rhs) const;
144 [[nodiscard]]
bool less_than(const
self_type& rhs) const;
252 template <input_metadata_container METADATA_RANGE = std::vector<metadata_pair>>
255 std::optional<std::string_view>
name = std::nullopt,
256 std::optional<METADATA_RANGE>
metadata = std::nullopt
528 template <input_metadata_container METADATA_RANGE = std::vector<metadata_pair>>
530 create_proxy(
size_t length, std::optional<std::string_view>
name, std::optional<METADATA_RANGE>
metadata);
591 auto empty_iterator<T>::dereference() const ->
reference
597 void empty_iterator<T>::increment()
617 return rhs.m_index - m_index;
623 return m_index == rhs.m_index;
629 return m_index < rhs.m_index;
632 template <input_metadata_container METADATA_RANGE>
634 null_array::create_proxy(
size_t length, std::optional<std::string_view> name, std::optional<METADATA_RANGE> metadata)
636 using namespace std::literals;
637 static const std::optional<std::unordered_set<sparrow::ArrowFlag>> flags{{
ArrowFlag::NULLABLE}};
644 repeat_view<bool>(
false, 0),
649 using buffer_type = sparrow::buffer<std::uint8_t>;
650 std::vector<buffer_type> arr_buffs = {};
653 static_cast<int64_t
>(length),
654 static_cast<int64_t
>(length),
656 std::move(arr_buffs),
658 repeat_view<bool>(
false, 0),
662 return arrow_proxy{std::move(arr), std::move(schema)};
666#if defined(__cpp_lib_format)
672 constexpr auto parse(std::format_parse_context& ctx)
677 auto format(
const sparrow::null_array& ar, std::format_context& ctx)
const
679 return std::format_to(ctx.out(),
"Null array [{}]", ar.
size());
683inline std::ostream&
operator<<(std::ostream& os,
const sparrow::null_array& value)
685 os << std::format(
"{}", value);
Iterator for null arrays where all elements are null.
empty_iterator< T > self_type
typename base_type::reference reference
iterator_base< self_type, T, std::contiguous_iterator_tag, T > base_type
friend class iterator_access
typename base_type::difference_type difference_type
empty_iterator(difference_type index=difference_type()) noexcept
Constructs an empty iterator at the specified position.
Memory-efficient array implementation for null data types.
SPARROW_API const_reference back() const
Gets const reference to the last element.
SPARROW_API const_reverse_iterator crend() const
Gets const reverse iterator to the end of reversed array.
SPARROW_API iterator begin()
Gets iterator to the beginning of the array.
SPARROW_API reverse_iterator rbegin()
Gets reverse iterator to the beginning of reversed array.
SPARROW_API iterator end()
Gets iterator to the end of the array.
SPARROW_API std::optional< std::string_view > name() const
Gets the optional name of the array.
iterator::reference reference
SPARROW_API const_reverse_iterator rend() const
Gets const reverse iterator to the end of reversed array.
null_type inner_value_type
empty_iterator< value_type > const_iterator
empty_iterator< int > const_value_iterator
SPARROW_API reference back()
Gets reference to the last element.
SPARROW_API size_type size() const
Gets the number of elements in the array.
SPARROW_API const_bitmap_range bitmap() const
Gets the validity bitmap as a range (all false for null arrays).
SPARROW_API const_iterator cend() const
Gets const iterator to the end of the array.
SPARROW_API const_reference front() const
Gets const reference to the first element.
SPARROW_API const_iterator end() const
Gets const iterator to the end of the array.
SPARROW_API const_reverse_iterator crbegin() const
Gets const reverse iterator to the beginning of reversed array.
std::ranges::subrange< const_bitmap_iterator > const_bitmap_range
empty_iterator< bool > const_bitmap_iterator
std::reverse_iterator< const_iterator > const_reverse_iterator
SPARROW_API const_reference operator[](size_type i) const
Gets const reference to element at specified position.
empty_iterator< value_type > iterator
nullable< inner_value_type > value_type
SPARROW_API std::optional< key_value_view > metadata() const
Gets the metadata associated with the array.
SPARROW_API null_array(arrow_proxy)
Constructs null array from Arrow proxy.
std::random_access_iterator_tag iterator_tag
std::ranges::subrange< const_value_iterator > const_value_range
SPARROW_API const_reverse_iterator rbegin() const
Gets const reverse iterator to the beginning of reversed array.
SPARROW_API const_iterator begin() const
Gets const iterator to the beginning of the array.
iterator::difference_type difference_type
null_array(size_t length, std::optional< std::string_view > name=std::nullopt, std::optional< METADATA_RANGE > metadata=std::nullopt)
Constructs a null array with specified length and metadata.
const_iterator::reference const_reference
SPARROW_API const_value_range values() const
Gets the values as a range (conceptually empty for null arrays).
SPARROW_API reference front()
Gets reference to the first element.
SPARROW_API reference operator[](size_type i)
Gets mutable reference to element at specified position.
SPARROW_API const_iterator cbegin() const
Gets const iterator to the beginning of the array.
SPARROW_API reverse_iterator rend()
Gets reverse iterator to the end of reversed array.
std::reverse_iterator< iterator > reverse_iterator
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.
SPARROW_API bool operator==(const array &lhs, const array &rhs)
Compares the content of two arrays.
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.
constexpr bool is_null_array_v
Type trait to check if a type is a null_array.
data_type
Runtime identifier of arrow data types, usually associated with raw bytes with the associated value.
std::ostream & operator<<(std::ostream &os, const sparrow::nullval_t &)
static constexpr sparrow::data_type get()
Metafunction for retrieving the data_type of a typed array.