Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::ArrowArrayScanState Struct Reference
Collaboration diagram for duckdb::ArrowArrayScanState:

Public Member Functions

 ArrowArrayScanState (ClientContext &context)
ArrowArrayScanState & GetChild (idx_t child_idx)
void AddDictionary (unique_ptr< Vector > dictionary_p, ArrowArray *arrow_dict)
bool HasDictionary () const
bool CacheOutdated (ArrowArray *dictionary) const
Vector & GetDictionary ()
ArrowRunEndEncodingState & RunEndEncoding ()
void Reset ()

Public Attributes

shared_ptr< ArrowArrayWrapper > owned_data
unordered_map< idx_t, unique_ptr< ArrowArrayScanState > > children
optional_ptr< ArrowArray > arrow_dictionary = nullptr
unique_ptr< Vector > dictionary
ArrowRunEndEncodingState run_end_encoding
 Run-end-encoding state.
ClientContext & context

Constructor & Destructor Documentation

◆ ArrowArrayScanState()

duckdb::ArrowArrayScanState::ArrowArrayScanState ( ClientContext & context)
explicit
238949 : context(context) {
238950 arrow_dictionary = nullptr;
238951}

Member Function Documentation

◆ GetChild()

ArrowArrayScanState & duckdb::ArrowArrayScanState::GetChild ( idx_t child_idx)
238953 {
238954 auto it = children.find(child_idx);
238955 if (it == children.end()) {
238956 auto child_p = make_uniq<ArrowArrayScanState>(context);
238957 auto &child = *child_p;
238958 child.owned_data = owned_data;
238959 children.emplace(child_idx, std::move(child_p));
238960 return child;
238961 }
238962 if (!it->second->owned_data) {
238963 // Propagate down the ownership, for dictionaries in children
238964 D_ASSERT(owned_data);
238965 it->second->owned_data = owned_data;
238966 }
238967 return *it->second;
238968}

◆ AddDictionary()

void duckdb::ArrowArrayScanState::AddDictionary ( unique_ptr< Vector > dictionary_p,
ArrowArray * arrow_dict )
238970 {
238971 dictionary = std::move(dictionary_p);
238972 D_ASSERT(owned_data);
238973 D_ASSERT(arrow_dict);
238974 arrow_dictionary = arrow_dict;
238975 // Make sure the data referenced by the dictionary stays alive
238976 dictionary->GetBuffer()->SetAuxiliaryData(make_uniq<ArrowAuxiliaryData>(owned_data));
238977}

◆ HasDictionary()

bool duckdb::ArrowArrayScanState::HasDictionary ( ) const
238979 {
238980 return dictionary != nullptr;
238981}

◆ CacheOutdated()

bool duckdb::ArrowArrayScanState::CacheOutdated ( ArrowArray * dictionary) const
238983 {
238984 if (!dictionary) {
238985 // Not cached
238986 return true;
238987 }
238988 if (dictionary == arrow_dictionary.get()) {
238989 // Already cached, not outdated
238990 return false;
238991 }
238992 return true;
238993}

◆ GetDictionary()

Vector & duckdb::ArrowArrayScanState::GetDictionary ( )
238995 {
238996 D_ASSERT(HasDictionary());
238997 return *dictionary;
238998}

◆ RunEndEncoding()

ArrowRunEndEncodingState & duckdb::ArrowArrayScanState::RunEndEncoding ( )
inline
27355 {
27356 return run_end_encoding;
27357 }
ArrowRunEndEncodingState run_end_encoding
Run-end-encoding state.
Definition duckdb.cpp:27346

◆ Reset()

void duckdb::ArrowArrayScanState::Reset ( )
inline
27360 {
27361 // Note: dictionary is not reset
27362 // the dictionary should be the same for every array scanned of this column
27363 run_end_encoding.Reset();
27364 for (auto &child : children) {
27365 child.second->Reset();
27366 }
27367 owned_data.reset();
27368 }

The documentation for this struct was generated from the following file: