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::StructFilter Class Reference
Inheritance diagram for duckdb::StructFilter:
Collaboration diagram for duckdb::StructFilter:

Public Member Functions

 StructFilter (idx_t child_idx, string child_name, unique_ptr< TableFilter > child_filter)
FilterPropagateResult CheckStatistics (BaseStatistics &stats) const override
 Returns true if the statistics indicate that the segment can contain values that satisfy that filter.
string ToString (const string &column_name) const override
bool Equals (const TableFilter &other) const override
unique_ptr< TableFilter > Copy () const override
unique_ptr< Expression > ToExpression (const Expression &column) const override
void Serialize (Serializer &serializer) const override
Public Member Functions inherited from duckdb::TableFilter
 TableFilter (TableFilterType filter_type_p)
string DebugToString () const
template<class TARGET>
TARGET & Cast ()
template<class TARGET>
const TARGET & Cast () const

Static Public Member Functions

static unique_ptr< TableFilter > Deserialize (Deserializer &deserializer)
Static Public Member Functions inherited from duckdb::TableFilter
static unique_ptr< TableFilter > Deserialize (Deserializer &deserializer)

Public Attributes

idx_t child_idx
 The field index to filter on.
string child_name
 The field name to filter on.
unique_ptr< TableFilter > child_filter
 The child filter.
Public Attributes inherited from duckdb::TableFilter
TableFilterType filter_type

Static Public Attributes

static constexpr const TableFilterType TYPE = TableFilterType::STRUCT_EXTRACT

Constructor & Destructor Documentation

◆ StructFilter()

duckdb::StructFilter::StructFilter ( idx_t child_idx,
string child_name,
unique_ptr< TableFilter > child_filter )
380306 : TableFilter(TableFilterType::STRUCT_EXTRACT), child_idx(child_idx_p), child_name(std::move(child_name_p)),
380307 child_filter(std::move(child_filter_p)) {
380308}
idx_t child_idx
The field index to filter on.
Definition duckdb.cpp:81206
string child_name
The field name to filter on.
Definition duckdb.cpp:81209
unique_ptr< TableFilter > child_filter
The child filter.
Definition duckdb.cpp:81212

Member Function Documentation

◆ CheckStatistics()

FilterPropagateResult duckdb::StructFilter::CheckStatistics ( BaseStatistics & stats) const
overridevirtual

Returns true if the statistics indicate that the segment can contain values that satisfy that filter.

Implements duckdb::TableFilter.

380310 {
380311 D_ASSERT(stats.GetType().id() == LogicalTypeId::STRUCT);
380312 // Check the child statistics
380313 auto &child_stats = StructStats::GetChildStats(stats, child_idx);
380314 return child_filter->CheckStatistics(child_stats);
380315}

◆ ToString()

string duckdb::StructFilter::ToString ( const string & column_name) const
overridevirtual

Implements duckdb::TableFilter.

380317 {
380318 if (!child_name.empty()) {
380319 return child_filter->ToString(column_name + "." + child_name);
380320 }
380321 return child_filter->ToString("struct_extract_at(" + column_name + "," + std::to_string(child_idx + 1) + ")");
380322}

◆ Equals()

bool duckdb::StructFilter::Equals ( const TableFilter & other) const
overridevirtual

Reimplemented from duckdb::TableFilter.

380324 {
380325 if (!TableFilter::Equals(other_p)) {
380326 return false;
380327 }
380328 auto &other = other_p.Cast<StructFilter>();
380329 if ((!child_name.empty()) && (!other.child_name.empty())) { // if both child_names are known, sanity check
380330 D_ASSERT((other.child_idx == child_idx) == StringUtil::CIEquals(other.child_name, child_name));
380331 }
380332 return other.child_idx == child_idx && other.child_filter->Equals(*child_filter);
380333}
static DUCKDB_API bool CIEquals(const string &l1, const string &l2)
Case insensitive equals.
Definition duckdb.cpp:109696

◆ Copy()

unique_ptr< TableFilter > duckdb::StructFilter::Copy ( ) const
overridevirtual

Implements duckdb::TableFilter.

380335 {
380336 return make_uniq<StructFilter>(child_idx, child_name, child_filter->Copy());
380337}

◆ ToExpression()

unique_ptr< Expression > duckdb::StructFilter::ToExpression ( const Expression & column) const
overridevirtual

Implements duckdb::TableFilter.

380339 {
380340 auto &child_type = StructType::GetChildType(column.return_type, child_idx);
380341 vector<unique_ptr<Expression>> arguments;
380342 arguments.push_back(column.Copy());
380343 arguments.push_back(make_uniq<BoundConstantExpression>(Value::BIGINT(NumericCast<int64_t>(child_idx + 1))));
380344 auto child = make_uniq<BoundFunctionExpression>(child_type, GetExtractAtFunction(), std::move(arguments),
380345 StructExtractAtFun::GetBindData(child_idx));
380346 return child_filter->ToExpression(*child);
380347}
static DUCKDB_API Value BIGINT(int64_t value)
Create a bigint Value from a specified value.
Definition duckdb.cpp:132146

◆ Serialize()

void duckdb::StructFilter::Serialize ( Serializer & serializer) const
overridevirtual

Reimplemented from duckdb::TableFilter.

419560 {
419561 TableFilter::Serialize(serializer);
419562 serializer.WritePropertyWithDefault<idx_t>(200, "child_idx", child_idx);
419563 serializer.WritePropertyWithDefault<string>(201, "child_name", child_name);
419564 serializer.WritePropertyWithDefault<unique_ptr<TableFilter>>(202, "child_filter", child_filter);
419565}
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237

◆ Deserialize()

unique_ptr< TableFilter > duckdb::StructFilter::Deserialize ( Deserializer & deserializer)
static
419567 {
419568 auto child_idx = deserializer.ReadPropertyWithDefault<idx_t>(200, "child_idx");
419569 auto child_name = deserializer.ReadPropertyWithDefault<string>(201, "child_name");
419570 auto child_filter = deserializer.ReadPropertyWithDefault<unique_ptr<TableFilter>>(202, "child_filter");
419571 auto result = duckdb::unique_ptr<StructFilter>(new StructFilter(child_idx, std::move(child_name), std::move(child_filter)));
419572 return std::move(result);
419573}

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