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

Public Member Functions

 BoundCastExpression (unique_ptr< Expression > child, LogicalType target_type, BoundCastInfo bound_cast, bool try_cast=false)
 
LogicalType source_type ()
 
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.
 
unique_ptr< ExpressionCopy () const override
 Create a copy of this expression.
 
bool CanThrow () const override
 
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 IsFoldable () 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 >
TARGETCast ()
 
template<class TARGET >
const TARGETCast () const
 

Static Public Member Functions

static unique_ptr< ExpressionAddDefaultCastToType (unique_ptr< Expression > expr, const LogicalType &target_type, bool try_cast=false)
 Cast an expression to the specified SQL type, using only the built-in SQL casts.
 
static DUCKDB_API unique_ptr< ExpressionAddCastToType (ClientContext &context, unique_ptr< Expression > expr, const LogicalType &target_type, bool try_cast=false)
 Cast an expression to the specified SQL type if required.
 
static DUCKDB_API unique_ptr< ExpressionAddArrayCastToList (ClientContext &context, unique_ptr< Expression > expr)
 If the expression returns an array, cast it to return a list with the same child type. Otherwise do nothing.
 
static bool CastIsInvertible (const LogicalType &source_type, const LogicalType &target_type)
 
static unique_ptr< ExpressionDeserialize (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< ExpressionDeserialize (Deserializer &deserializer)
 
- Static Public Member Functions inherited from duckdb::BaseExpression
static bool Equals (const BaseExpression &left, const BaseExpression &right)
 

Public Attributes

unique_ptr< Expressionchild
 The child type.
 
bool try_cast
 Whether to use try_cast or not. try_cast converts cast failures into NULLs instead of throwing an error.
 
BoundCastInfo bound_cast
 The bound cast info.
 
- Public Attributes inherited from duckdb::Expression
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)
 

Static Public Attributes

static constexpr const ExpressionClass TYPE = ExpressionClass::BOUND_CAST
 

Private Member Functions

 BoundCastExpression (ClientContext &context, unique_ptr< Expression > child, LogicalType target_type)
 

Additional Inherited Members

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

Member Function Documentation

◆ source_type()

LogicalType duckdb::BoundCastExpression::source_type ( )
inline
80903 { // NOLINT: allow casing for legacy reasons
80904 D_ASSERT(child->return_type.IsValid());
80905 return child->return_type;
80906 }
unique_ptr< Expression > child
The child type.
Definition duckdb.cpp:80896

◆ CastIsInvertible()

static bool duckdb::BoundCastExpression::CastIsInvertible ( const LogicalType source_type,
const LogicalType target_type 
)
static

Returns true if a cast is invertible (i.e. CAST(s -> t -> s) = s for all values of s). This is not true for e.g. boolean casts, because that can be e.g. -1 -> TRUE -> 1. This is necessary to prevent some optimizer bugs.

◆ ToString()

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

Convert the Expression to a String.

Implements duckdb::BaseExpression.

◆ Equals()

bool duckdb::BoundCastExpression::Equals ( const BaseExpression other) const
overridevirtual

Returns true if this expression is equal to another expression.

Reimplemented from duckdb::BaseExpression.

◆ Copy()

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

Create a copy of this expression.

Implements duckdb::Expression.

◆ CanThrow()

bool duckdb::BoundCastExpression::CanThrow ( ) const
overridevirtual

Reimplemented from duckdb::Expression.

◆ Serialize()

void duckdb::BoundCastExpression::Serialize ( Serializer serializer) const
overridevirtual

Reimplemented from duckdb::Expression.


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