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

Public Member Functions

 BoundParameterExpression (const string &identifier)
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.
bool IsFoldable () const override
string ToString () const override
 Convert the Expression to a String.
bool Equals (const BaseExpression &other) const override
 Returns true if this expression is equal to another expression.
hash_t Hash () const override
unique_ptr< Expression > Copy () const override
 Create a copy of this expression.
void Serialize (Serializer &serializer) const override
Public Member Functions inherited from duckdb::Expression
 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 CanThrow () const
hash_t Hash () const override
bool Equals (const BaseExpression &other) const override
 Returns true if this expression is equal to another expression.
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.
void Print () const
 Print the expression to stdout.
bool operator== (const BaseExpression &rhs) const
virtual void Verify () const
template<class TARGET>
TARGET & Cast ()
template<class TARGET>
const TARGET & Cast () const

Static Public Member Functions

static DUCKDB_API void Invalidate (Expression &expr)
 Invalidate a bound parameter expression - forcing a rebind on any subsequent filters.
static DUCKDB_API void InvalidateRecursive (Expression &expr)
 Invalidate all parameters within an expression.
static unique_ptr< Expression > Deserialize (Deserializer &deserializer)
Static Public Member Functions inherited from duckdb::Expression
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< Expression > Deserialize (Deserializer &deserializer)
Static Public Member Functions inherited from duckdb::BaseExpression
static bool Equals (const BaseExpression &left, const BaseExpression &right)

Public Attributes

string identifier
shared_ptr< BoundParameterData > parameter_data
Public Attributes inherited from duckdb::Expression
LogicalType return_type
 The return type of the expression.
unique_ptr< BaseStatistics > verification_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).

Static Public Attributes

static constexpr const ExpressionClass TYPE = ExpressionClass::BOUND_PARAMETER

Private Member Functions

 BoundParameterExpression (bound_parameter_map_t &global_parameter_set, string identifier, LogicalType return_type, shared_ptr< BoundParameterData > parameter_data)

Additional Inherited Members

Protected Member Functions inherited from duckdb::Expression
void CopyProperties (const Expression &other)

Constructor & Destructor Documentation

◆ BoundParameterExpression() [1/2]

duckdb::BoundParameterExpression::BoundParameterExpression ( const string & identifier)
explicit
376662 : Expression(ExpressionType::VALUE_PARAMETER, ExpressionClass::BOUND_PARAMETER,
376663 LogicalType(LogicalTypeId::UNKNOWN)),
376664 identifier(identifier) {
376665}

◆ BoundParameterExpression() [2/2]

duckdb::BoundParameterExpression::BoundParameterExpression ( bound_parameter_map_t & global_parameter_set,
string identifier,
LogicalType return_type,
shared_ptr< BoundParameterData > parameter_data )
private
376670 : Expression(ExpressionType::VALUE_PARAMETER, ExpressionClass::BOUND_PARAMETER, std::move(return_type)),
376671 identifier(std::move(identifier)) {
376672 // check if we have already deserialized a parameter with this number
376673 auto entry = global_parameter_set.find(this->identifier);
376674 if (entry == global_parameter_set.end()) {
376675 // we have not - store the entry we deserialized from this parameter expression
376676 global_parameter_set[this->identifier] = parameter_data;
376677 } else {
376678 // we have! use the previously deserialized entry
376679 parameter_data = entry->second;
376680 }
376681 this->parameter_data = std::move(parameter_data);
376682}
LogicalType return_type
The return type of the expression.
Definition duckdb.hpp:17743

Member Function Documentation

◆ Invalidate()

void duckdb::BoundParameterExpression::Invalidate ( Expression & expr)
static

Invalidate a bound parameter expression - forcing a rebind on any subsequent filters.

376684 {
376685 if (expr.GetExpressionType() != ExpressionType::VALUE_PARAMETER) {
376686 throw InternalException("BoundParameterExpression::Invalidate requires a parameter as input");
376687 }
376688 auto &bound_parameter = expr.Cast<BoundParameterExpression>();
376689 bound_parameter.return_type = LogicalTypeId::SQLNULL;
376690 bound_parameter.parameter_data->return_type = LogicalTypeId::INVALID;
376691}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ InvalidateRecursive()

void duckdb::BoundParameterExpression::InvalidateRecursive ( Expression & expr)
static

Invalidate all parameters within an expression.

376693 {
376694 if (expr.GetExpressionType() == ExpressionType::VALUE_PARAMETER) {
376695 Invalidate(expr);
376696 return;
376697 }
376698 ExpressionIterator::EnumerateChildren(expr, [&](Expression &child) { InvalidateRecursive(child); });
376699}
static DUCKDB_API void InvalidateRecursive(Expression &expr)
Invalidate all parameters within an expression.
Definition duckdb.cpp:376693
static DUCKDB_API void Invalidate(Expression &expr)
Invalidate a bound parameter expression - forcing a rebind on any subsequent filters.
Definition duckdb.cpp:376684
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsScalar()

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

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

Implements duckdb::BaseExpression.

376701 {
376702 return true;
376703}

◆ HasParameter()

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

Returns true if the expression has a parameter.

Implements duckdb::BaseExpression.

376704 {
376705 return true;
376706}

◆ IsFoldable()

bool duckdb::BoundParameterExpression::IsFoldable ( ) const
overridevirtual

Reimplemented from duckdb::Expression.

376707 {
376708 return false;
376709}

◆ ToString()

string duckdb::BoundParameterExpression::ToString ( ) const
overridevirtual

Convert the Expression to a String.

Implements duckdb::BaseExpression.

376711 {
376712 return "$" + identifier;
376713}

◆ Equals()

bool duckdb::BoundParameterExpression::Equals ( const BaseExpression & other) const
overridevirtual

Returns true if this expression is equal to another expression.

Reimplemented from duckdb::BaseExpression.

376715 {
376716 if (!Expression::Equals(other_p)) {
376717 return false;
376718 }
376719 auto &other = other_p.Cast<BoundParameterExpression>();
376720 return StringUtil::CIEquals(identifier, other.identifier);
376721}
bool Equals(const BaseExpression &other) const override
Returns true if this expression is equal to another expression.
Definition duckdb.hpp:17762
static DUCKDB_API bool CIEquals(const string &l1, const string &l2)
Case insensitive equals.
Definition duckdb.cpp:109696
Here is the call graph for this function:

◆ Hash()

hash_t duckdb::BoundParameterExpression::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.

376723 {
376724 hash_t result = Expression::Hash();
376725 result = CombineHash(duckdb::Hash(identifier.c_str(), identifier.size()), result);
376726 return result;
376727}
hash_t Hash() const override
Definition duckdb.cpp:377203
uint64_t hash_t
The type used for hashes.
Definition duckdb.hpp:243
hash_t CombineHash(hash_t left, hash_t right)
Combine two hashes by XORing them.
Definition duckdb.hpp:4635
Here is the call graph for this function:

◆ Copy()

unique_ptr< Expression > duckdb::BoundParameterExpression::Copy ( ) const
overridevirtual

Create a copy of this expression.

Implements duckdb::Expression.

376729 {
376730 auto result = make_uniq<BoundParameterExpression>(identifier);
376731 result->parameter_data = parameter_data;
376732 result->return_type = return_type;
376733 result->CopyProperties(*this);
376734 return std::move(result);
376735}

◆ Serialize()

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

Reimplemented from duckdb::Expression.

416158 {
416159 Expression::Serialize(serializer);
416160 serializer.WritePropertyWithDefault<string>(200, "identifier", identifier);
416161 serializer.WriteProperty<LogicalType>(201, "return_type", return_type);
416162 serializer.WritePropertyWithDefault<shared_ptr<BoundParameterData>>(202, "parameter_data", parameter_data);
416163}

◆ Deserialize()

unique_ptr< Expression > duckdb::BoundParameterExpression::Deserialize ( Deserializer & deserializer)
static
416165 {
416166 auto identifier = deserializer.ReadPropertyWithDefault<string>(200, "identifier");
416167 auto return_type = deserializer.ReadProperty<LogicalType>(201, "return_type");
416168 auto parameter_data = deserializer.ReadPropertyWithDefault<shared_ptr<BoundParameterData>>(202, "parameter_data");
416169 auto result = duckdb::unique_ptr<BoundParameterExpression>(new BoundParameterExpression(deserializer.Get<bound_parameter_map_t &>(), std::move(identifier), std::move(return_type), std::move(parameter_data)));
416170 return std::move(result);
416171}

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