107 [[nodiscard]] std::optional<std::string_view>
name()
const;
108 [[nodiscard]] std::optional<std::string_view>
metadata()
const;
110 [[nodiscard]]
bool empty()
const;
183#if defined(__cpp_lib_format)
184 friend struct std::formatter<D>;
236 std::ostringstream oss117;
237 oss117 <<
"Index " << i <<
"is greater or equal to size of array (" <<
size() <<
")";
238 throw std::out_of_range(oss117.str());
277 return (*
this)[
size() - 1];
390 : m_proxy(
std::move(proxy))
462 return std::ranges::equal(lhs, rhs);
466#if defined(__cpp_lib_format)
469 requires std::derived_from<D, sparrow::array_crtp_base<D>>
470struct std::formatter<D>
472 constexpr auto parse(std::format_parse_context& ctx)
477 auto format(
const D& ar, std::format_context& ctx)
const
479 const auto& proxy = ar.get_arrow_proxy();
481 if (proxy.dictionary())
483 std::format_to(ctx.out(),
"Dictionary<{}>", proxy.dictionary()->data_type());
487 std::format_to(ctx.out(),
"{}", proxy.data_type());
489 std::format_to(ctx.out(),
" [name={} | size={}] <", ar.name().value_or(
"nullptr"), proxy.length());
493 std::prev(ar.cend()),
494 [&ctx](
const auto& value)
496 std::format_to(ctx.out(),
"{}, ", value);
499 return std::format_to(ctx.out(),
"{}>", ar.back());
504 requires std::derived_from<D, sparrow::array_crtp_base<D>>
505std::ostream&
operator<<(std::ostream& os,
const D& value)
507 os << std::format(
"{}", value);
Base class defining common immutable interface for arrays with a bitmap.
array_crtp_base(arrow_proxy)
std::optional< std::string_view > metadata() const
D slice_view(size_type start, size_type end) const
Slices the array to keep only the elements between the given start and end.
array_crtp_base & operator=(const array_crtp_base &)=default
const_reverse_iterator rend() const
Returns a reverse iterator to the element following the last element of the reversed array.
const_reverse_iterator crend() const
Returns a reverse iterator to the element following the last element of the reversed array.
typename inner_types::const_value_iterator const_value_iterator
const_reference back() const
Returns a constant reference to the last element in the container.
bitmap_type::const_reference bitmap_const_reference
std::ranges::subrange< const_value_iterator > const_value_range
bitmap_type::iterator bitmap_iterator
bool empty() const
Checks if the array has no element, i.e.
const_reference operator[](size_type i) const
Returns a constant reference to the element at the specified position in the array.
const_value_range values() const
Returns the raw values of the array (i.e.
const_reference front() const
Returns a constant reference to the first element in the container.
arrow_proxy & get_arrow_proxy()
nullable< inner_const_reference, bitmap_const_reference > const_reference
const_bitmap_iterator bitmap_end() const
const_bitmap_range bitmap() const
Returns the validity bitmap of the array (i.e.
typename inner_types::iterator_tag iterator_tag
const_bitmap_iterator bitmap_cend() const
std::ranges::subrange< const_bitmap_iterator > const_bitmap_range
const_bitmap_iterator bitmap_cbegin() const
const_iterator begin() const
Returns a constant iterator to the first element of the array.
typename inner_types::bitmap_type bitmap_type
const_iterator end() const
Returns a constant iterator to the element following the last element of the array.
bitmap_type::const_iterator const_bitmap_iterator
array_crtp_base(const array_crtp_base &)=default
typename inner_types::inner_const_reference inner_const_reference
size_type size() const
Returns the number of elements in the array.
D slice(size_type start, size_type end) const
Slices the array to keep only the elements between the given start and end.
nullable< inner_value_type > value_type
const_iterator cbegin() const
Returns a constant iterator to the first element of the array.
std::ptrdiff_t difference_type
layout_iterator< iterator_types > const_iterator
std::optional< std::string_view > name() const
const_bitmap_iterator bitmap_begin() const
array_crtp_base< D > self_type
std::reverse_iterator< const_iterator > const_reverse_iterator
const_reverse_iterator rbegin() const
Returns a constant reverse iterator to the first element of the reversed array.
const_reverse_iterator crbegin() const
Returns a constant reverse iterator to the first element of the reversed array.
bitmap_const_reference has_value(size_type i) const
array_crtp_base & operator=(array_crtp_base &&)=default
array_crtp_base(array_crtp_base &&)=default
array_inner_types< derived_type > inner_types
const_iterator cend() const
Returns a constant iterator to the element following the last element of the array.
const_reference at(size_type i) const
Returns a constant reference to the element at the specified position in the array with bounds checki...
typename inner_types::inner_value_type inner_value_type
Proxy class over ArrowArray and ArrowSchema.
Base class for CRTP base classes.
derived_type & derived_cast()
This class represents a view to a dynamic size sequence of bits.
base_type::const_reference const_reference
bitmap_type::const_reference bitmap_const_reference
base_type::const_iterator const_iterator
base_type::size_type size_type
base_type::const_bitmap_range const_bitmap_range
iterator end()
Returns a iterator to the element following the last element of the array.
The nullable class models a value or a reference that can be "null", or missing, like values traditio...
Concept for iterator types.
#define SPARROW_ASSERT_TRUE(expr__)
SPARROW_API bool operator==(const array &lhs, const array &rhs)
Compares the content of two arrays.
constexpr InputIt next(InputIt it, Distance n)
std::ostream & operator<<(std::ostream &stream, T n)
self_type::const_reference reference
self_type::const_bitmap_iterator bitmap_iterator
self_type::iterator_tag iterator_tag
self_type::value_type value_type
self_type::const_value_iterator value_iterator
Base class for array_inner_types specialization.
dynamic_bitset_view< std::uint8_t > bitmap_type
Traits class that must be specialized by array classes inheriting from array_crtp_base.