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

Public Member Functions

 DistinctAggregateOptimizer (ExpressionRewriter &rewriter)
unique_ptr< Expression > Apply (LogicalOperator &op, vector< reference< Expression > > &bindings, bool &changes_made, bool is_root) override
Public Member Functions inherited from duckdb::Rule
 Rule (ExpressionRewriter &rewriter)
ClientContext & GetContext () const

Static Public Member Functions

static unique_ptr< Expression > Apply (ClientContext &context, BoundAggregateExpression &aggr, bool &changes_made)

Additional Inherited Members

Public Attributes inherited from duckdb::Rule
ExpressionRewriter & rewriter
 The expression rewriter this rule belongs to.
unique_ptr< ExpressionMatcher > root
 The expression matcher of the rule.

Constructor & Destructor Documentation

◆ DistinctAggregateOptimizer()

duckdb::DistinctAggregateOptimizer::DistinctAggregateOptimizer ( ExpressionRewriter & rewriter)
explicit
320690 : Rule(rewriter) {
320691 root = make_uniq<ExpressionMatcher>();
320692 root->expr_class = ExpressionClass::BOUND_AGGREGATE;
320693}
ExpressionRewriter & rewriter
The expression rewriter this rule belongs to.
Definition duckdb.cpp:69564
unique_ptr< ExpressionMatcher > root
The expression matcher of the rule.
Definition duckdb.cpp:69566

Member Function Documentation

◆ Apply() [1/2]

unique_ptr< Expression > duckdb::DistinctAggregateOptimizer::Apply ( ClientContext & context,
BoundAggregateExpression & aggr,
bool & changes_made )
static
320696 {
320697 if (!aggr.IsDistinct()) {
320698 // no DISTINCT defined
320699 return nullptr;
320700 }
320701 if (aggr.function.GetDistinctDependent() == AggregateDistinctDependent::NOT_DISTINCT_DEPENDENT) {
320702 // not a distinct-sensitive aggregate but we have an DISTINCT modifier - remove it
320703 aggr.aggr_type = AggregateType::NON_DISTINCT;
320704 changes_made = true;
320705 return nullptr;
320706 }
320707 return nullptr;
320708}

◆ Apply() [2/2]

unique_ptr< Expression > duckdb::DistinctAggregateOptimizer::Apply ( LogicalOperator & op,
vector< reference< Expression > > & bindings,
bool & changes_made,
bool is_root )
overridevirtual

Implements duckdb::Rule.

320711 {
320712 auto &aggr = bindings[0].get().Cast<BoundAggregateExpression>();
320713 return Apply(rewriter.context, aggr, changes_made);
320714}

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