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::Expression Class Referenceabstract

The Expression class represents a bound Expression with a return type. More...

#include <duckdb.hpp>

Inheritance diagram for duckdb::Expression:
Collaboration diagram for duckdb::Expression:

Public Member Functions

 Expression (ExpressionType type, ExpressionClass expression_class, LogicalType return_type)
 
bool IsAggregate () const override
 Returns true if this expression is an aggregate or not.
 
bool IsWindow () const override
 Returns true if the expression has a window function or not.
 
bool HasSubquery () const override
 Returns true if the query contains a subquery.
 
bool IsScalar () const override
 Returns true if expression does not contain a group ref or col ref or parameter.
 
bool HasParameter () const override
 Returns true if the expression has a parameter.
 
virtual bool IsVolatile () const
 
virtual bool IsConsistent () const
 
virtual bool PropagatesNullValues () const
 
virtual bool IsFoldable () const
 
virtual bool CanThrow () const
 
hash_t Hash () const override
 
bool Equals (const BaseExpression &other) const override
 Returns true if this expression is equal to another expression.
 
virtual unique_ptr< ExpressionCopy () const =0
 Create a copy of this expression.
 
virtual void Serialize (Serializer &serializer) const
 
- Public Member Functions inherited from duckdb::BaseExpression
 BaseExpression (ExpressionType type, ExpressionClass expression_class)
 Create an Expression.
 
ExpressionClass GetExpressionClass () const
 Returns the class of the expression.
 
ExpressionType GetExpressionType () const
 Returns the type of the expression.
 
void SetExpressionTypeUnsafe (ExpressionType new_type)
 
optional_idx GetQueryLocation () const
 Returns the location in the query (if any)
 
void SetQueryLocation (optional_idx location)
 Sets the location in the query.
 
bool HasAlias () const
 Returns true if the expression has a non-empty alias.
 
const string & GetAlias () const
 Returns the alias of the expression.
 
void SetAlias (const string &alias_p)
 Sets the alias of the expression.
 
void SetAlias (string &&alias_p)
 Sets the alias of the expression.
 
void ClearAlias ()
 Clears the alias of the expression.
 
virtual string GetName () const
 Get the name of the expression.
 
virtual string ToString () const =0
 Convert the Expression to a String.
 
void Print () const
 Print the expression to stdout.
 
bool operator== (const BaseExpression &rhs) const
 
virtual void Verify () const
 
template<class TARGET >
TARGETCast ()
 
template<class TARGET >
const TARGETCast () const
 

Static Public Member Functions

static bool Equals (const Expression &left, const Expression &right)
 
static bool Equals (const unique_ptr< Expression > &left, const unique_ptr< Expression > &right)
 
static bool ListEquals (const vector< unique_ptr< Expression > > &left, const vector< unique_ptr< Expression > > &right)
 
static unique_ptr< ExpressionDeserialize (Deserializer &deserializer)
 
- Static Public Member Functions inherited from duckdb::BaseExpression
static bool Equals (const BaseExpression &left, const BaseExpression &right)
 

Public Attributes

LogicalType return_type
 The return type of the expression.
 
unique_ptr< BaseStatisticsverification_stats
 Expression statistics (if any) - ONLY USED FOR VERIFICATION.
 
- Public Attributes inherited from duckdb::BaseExpression
ExpressionType type
 Type of the expression.
 
ExpressionClass expression_class
 The expression class of the node.
 
string alias
 The alias of the expression,.
 
optional_idx query_location
 The location in the query (if any)
 

Protected Member Functions

void CopyProperties (const Expression &other)
 

Detailed Description

The Expression class represents a bound Expression with a return type.

Member Function Documentation

◆ IsAggregate()

bool duckdb::Expression::IsAggregate ( ) const
overridevirtual

Returns true if this expression is an aggregate or not.

Examples:

(1) SUM(a) + 1 – True

(2) a + 1 – False

Implements duckdb::BaseExpression.

◆ IsWindow()

bool duckdb::Expression::IsWindow ( ) const
overridevirtual

Returns true if the expression has a window function or not.

Implements duckdb::BaseExpression.

◆ HasSubquery()

bool duckdb::Expression::HasSubquery ( ) const
overridevirtual

Returns true if the query contains a subquery.

Implements duckdb::BaseExpression.

◆ IsScalar()

bool duckdb::Expression::IsScalar ( ) const
overridevirtual

Returns true if expression does not contain a group ref or col ref or parameter.

Implements duckdb::BaseExpression.

◆ HasParameter()

bool duckdb::Expression::HasParameter ( ) const
overridevirtual

Returns true if the expression has a parameter.

Implements duckdb::BaseExpression.

◆ Hash()

hash_t duckdb::Expression::Hash ( ) const
overridevirtual

Creates a hash value of this expression. It is important that if two expressions are identical (i.e. Expression::Equals() returns true), that their hash value is identical as well.

Implements duckdb::BaseExpression.

◆ Equals() [1/2]

bool duckdb::Expression::Equals ( const BaseExpression other) const
inlineoverridevirtual

Returns true if this expression is equal to another expression.

Reimplemented from duckdb::BaseExpression.

17762 {
17763 if (!BaseExpression::Equals(other)) {
17764 return false;
17765 }
17766 return return_type == reinterpret_cast<const Expression &>(other).return_type;
17767 }
virtual bool Equals(const BaseExpression &other) const
Returns true if this expression is equal to another expression.
LogicalType return_type
The return type of the expression.
Definition duckdb.hpp:17743
Here is the call graph for this function:

◆ Equals() [2/2]

static bool duckdb::Expression::Equals ( const Expression left,
const Expression right 
)
inlinestatic
17768 {
17769 return left.Equals(right);
17770 }

◆ Copy()

◆ CopyProperties()

void duckdb::Expression::CopyProperties ( const Expression other)
inlineprotected

Copy base Expression properties from another expression to this one, used in Copy method

17782 {
17783 type = other.type;
17784 expression_class = other.expression_class;
17785 alias = other.alias;
17786 return_type = other.return_type;
17787 query_location = other.query_location;
17788 }
string alias
The alias of the expression,.
Definition duckdb.hpp:13293
ExpressionClass expression_class
The expression class of the node.
Definition duckdb.hpp:13290
optional_idx query_location
The location in the query (if any)
Definition duckdb.hpp:13296
ExpressionType type
Type of the expression.
Definition duckdb.hpp:13287

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