26#include <memory_resource>
27#include <unordered_set>
50template <
bool kVal
idate = true>
53 static constexpr size_t kDefaultArenaInitialSize = 64 * 1024;
57 size_t arena_initial_size = kDefaultArenaInitialSize);
76 using is_transparent = void;
77 size_t operator()(
const std::unique_ptr<StructLike>& p)
const noexcept;
78 size_t operator()(
const StructLike& s)
const noexcept;
83 using is_transparent = void;
84 bool operator()(
const std::unique_ptr<StructLike>& lhs,
85 const std::unique_ptr<StructLike>& rhs)
const noexcept;
87 const std::unique_ptr<StructLike>& rhs)
const noexcept;
88 bool operator()(
const std::unique_ptr<StructLike>& lhs,
93 Result<std::unique_ptr<StructLike>> MakeArenaRow(
const StructLike& row)
const;
97 Result<Scalar> DeepCopyScalar(
const Scalar& scalar)
const;
100 std::string_view CopyToArena(std::string_view src)
const;
102 std::vector<std::shared_ptr<Type>> field_types_;
103 mutable std::pmr::monotonic_buffer_resource arena_;
104 std::unordered_set<std::unique_ptr<StructLike>, KeyHash, KeyEqual> set_;
107extern template class ICEBERG_EXTERN_TEMPLATE_CLASS_EXPORT StructLikeSet<true>;
108extern template class ICEBERG_EXTERN_TEMPLATE_CLASS_EXPORT StructLikeSet<false>;
A set of StructLike rows with type-aware hashing and equality.
Definition struct_like_set.h:51
StructLikeSet(const StructType &type, size_t arena_initial_size=kDefaultArenaInitialSize)
Create a StructLikeSet for the given struct type.
size_t Size() const
Get the number of elements in the set.
bool IsEmpty() const
Check if the set is empty.
Result< bool > Contains(const StructLike &row) const
Check if the set contains a row.
Status Insert(const StructLike &row)
Insert a row into the set.
An immutable struct-like wrapper.
Definition struct_like.h:62
A data type representing a struct with nested fields.
Definition type.h:119
Define symbol visibility macros for core Iceberg APIs.
Core Apache Iceberg C++ APIs.
Definition arrow_io_util.h:33
std::expected< T, E > Result
Result alias.
Definition result.h:88
ICEBERG_EXPORT Result< bool > StructLikeEqual(const StructLike &lhs, const StructLike &rhs)
Compare two StructLike rows by scalar values.
Define Result, Status, and error helpers.