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::LogicalType Struct Reference
Collaboration diagram for duckdb::LogicalType:

Public Member Functions

DUCKDB_API LogicalType (LogicalTypeId id)
 
DUCKDB_API LogicalType (LogicalTypeId id, shared_ptr< ExtraTypeInfo > type_info)
 
DUCKDB_API LogicalType (const LogicalType &other)
 
DUCKDB_API LogicalType (LogicalType &&other) noexcept
 
LogicalTypeId id () const
 
PhysicalType InternalType () const
 
const optional_ptr< ExtraTypeInfoAuxInfo () const
 
bool IsNested () const
 
bool IsUnknown () const
 
bool IsUnbound () const
 
shared_ptr< ExtraTypeInfoGetAuxInfoShrPtr () const
 
LogicalType Copy () const
 Copies the logical type, making a new ExtraTypeInfo.
 
LogicalType DeepCopy () const
 DeepCopy() will make a unique copy of any nested ExtraTypeInfo as well.
 
void CopyAuxInfo (const LogicalType &other)
 
bool EqualTypeInfo (const LogicalType &rhs) const
 
LogicalTypeoperator= (const LogicalType &other)
 
LogicalTypeoperator= (LogicalType &&other) noexcept
 
DUCKDB_API bool operator== (const LogicalType &rhs) const
 
bool operator!= (const LogicalType &rhs) const
 
DUCKDB_API void Serialize (Serializer &serializer) const
 
DUCKDB_API string ToString () const
 
DUCKDB_API bool IsIntegral () const
 
DUCKDB_API bool IsFloating () const
 
DUCKDB_API bool IsNumeric () const
 
DUCKDB_API bool IsTemporal () const
 
DUCKDB_API hash_t Hash () const
 
DUCKDB_API void SetAlias (string alias)
 
DUCKDB_API bool HasAlias () const
 
DUCKDB_API string GetAlias () const
 
DUCKDB_API bool HasExtensionInfo () const
 
DUCKDB_API optional_ptr< const ExtensionTypeInfoGetExtensionInfo () const
 
DUCKDB_API optional_ptr< ExtensionTypeInfoGetExtensionInfo ()
 
DUCKDB_API void SetExtensionInfo (unique_ptr< ExtensionTypeInfo > info)
 
DUCKDB_API bool GetDecimalProperties (uint8_t &width, uint8_t &scale) const
 Gets the decimal properties of a numeric type. Fails if the type is not numeric.
 
DUCKDB_API void Verify () const
 
DUCKDB_API bool IsSigned () const
 
DUCKDB_API bool IsUnsigned () const
 
DUCKDB_API bool IsValid () const
 
DUCKDB_API bool IsComplete () const
 
DUCKDB_API bool IsTemplated () const
 
bool SupportsRegularUpdate () const
 True, if this type supports in-place updates.
 
DUCKDB_API bool IsJSONType () const
 

Static Public Member Functions

static DUCKDB_API LogicalType Deserialize (Deserializer &deserializer)
 
static bool TypeIsTimestamp (LogicalTypeId id)
 
static bool TypeIsTimestamp (const LogicalType &type)
 
static DUCKDB_API bool IsNumeric (LogicalTypeId type)
 
static DUCKDB_API LogicalType MaxLogicalType (ClientContext &context, const LogicalType &left, const LogicalType &right)
 Returns the maximum logical type when combining the two types - or throws an exception if combining is not possible.
 
static DUCKDB_API bool TryGetMaxLogicalType (ClientContext &context, const LogicalType &left, const LogicalType &right, LogicalType &result)
 
static DUCKDB_API bool TryGetMaxLogicalTypeUnchecked (const LogicalType &left, const LogicalType &right, LogicalType &result)
 
static DUCKDB_API LogicalType ForceMaxLogicalType (const LogicalType &left, const LogicalType &right)
 Forcibly returns a maximum logical type - similar to MaxLogicalType but never throws. As a fallback either left or right are returned.
 
static DUCKDB_API LogicalType NormalizeType (const LogicalType &type)
 Normalize a type - removing literals.
 
static DUCKDB_API LogicalType DECIMAL (uint8_t width, uint8_t scale)
 
static DUCKDB_API LogicalType VARCHAR_COLLATION (string collation)
 
static DUCKDB_API LogicalType LIST (const LogicalType &child)
 
static DUCKDB_API LogicalType STRUCT (child_list_t< LogicalType > children)
 
static DUCKDB_API LogicalType AGGREGATE_STATE (aggregate_state_t state_type)
 
static DUCKDB_API LogicalType MAP (const LogicalType &child)
 
static DUCKDB_API LogicalType MAP (LogicalType key, LogicalType value)
 
static DUCKDB_API LogicalType UNION (child_list_t< LogicalType > members)
 
static DUCKDB_API LogicalType ARRAY (const LogicalType &child, optional_idx index)
 
static DUCKDB_API LogicalType ENUM (Vector &ordered_data, idx_t size)
 
static DUCKDB_API LogicalType GEOMETRY ()
 
static DUCKDB_API LogicalType GEOMETRY (const string &crs)
 
static DUCKDB_API LogicalType GEOMETRY (const CoordinateReferenceSystem &crs)
 
static DUCKDB_API LogicalType ANY_PARAMS (LogicalType target, idx_t cast_score=5)
 
static DUCKDB_API LogicalType TEMPLATE (const string &name)
 
static DUCKDB_API LogicalType VARIANT ()
 
static DUCKDB_API LogicalType INTEGER_LITERAL (const Value &constant)
 Integer literal of the specified value.
 
static DUCKDB_API LogicalType ENUM (const string &enum_name, Vector &ordered_data, idx_t size)
 
static DUCKDB_API LogicalType UNBOUND (unique_ptr< ParsedExpression > expr)
 
static DUCKDB_API LogicalType TYPE ()
 
static DUCKDB_API const vector< LogicalTypeNumeric ()
 A list of all NUMERIC types (integral and floating point types)
 
static DUCKDB_API const vector< LogicalTypeIntegral ()
 A list of all INTEGRAL types.
 
static DUCKDB_API const vector< LogicalTypeReal ()
 A list of all REAL types.
 
static DUCKDB_API const vector< LogicalTypeAllTypes ()
 A list of ALL SQL types.
 
static DUCKDB_API LogicalType JSON ()
 

Static Public Attributes

static constexpr const LogicalTypeId SQLNULL = LogicalTypeId::SQLNULL
 
static constexpr const LogicalTypeId UNKNOWN = LogicalTypeId::UNKNOWN
 
static constexpr const LogicalTypeId BOOLEAN = LogicalTypeId::BOOLEAN
 
static constexpr const LogicalTypeId TINYINT = LogicalTypeId::TINYINT
 
static constexpr const LogicalTypeId UTINYINT = LogicalTypeId::UTINYINT
 
static constexpr const LogicalTypeId SMALLINT = LogicalTypeId::SMALLINT
 
static constexpr const LogicalTypeId USMALLINT = LogicalTypeId::USMALLINT
 
static constexpr const LogicalTypeId INTEGER = LogicalTypeId::INTEGER
 
static constexpr const LogicalTypeId UINTEGER = LogicalTypeId::UINTEGER
 
static constexpr const LogicalTypeId BIGINT = LogicalTypeId::BIGINT
 
static constexpr const LogicalTypeId UBIGINT = LogicalTypeId::UBIGINT
 
static constexpr const LogicalTypeId FLOAT = LogicalTypeId::FLOAT
 
static constexpr const LogicalTypeId DOUBLE = LogicalTypeId::DOUBLE
 
static constexpr const LogicalTypeId DATE = LogicalTypeId::DATE
 
static constexpr const LogicalTypeId TIMESTAMP = LogicalTypeId::TIMESTAMP
 
static constexpr const LogicalTypeId TIMESTAMP_S = LogicalTypeId::TIMESTAMP_SEC
 
static constexpr const LogicalTypeId TIMESTAMP_MS = LogicalTypeId::TIMESTAMP_MS
 
static constexpr const LogicalTypeId TIMESTAMP_NS = LogicalTypeId::TIMESTAMP_NS
 
static constexpr const LogicalTypeId TIME = LogicalTypeId::TIME
 
static constexpr const LogicalTypeId TIME_NS = LogicalTypeId::TIME_NS
 
static constexpr const LogicalTypeId TIMESTAMP_TZ = LogicalTypeId::TIMESTAMP_TZ
 
static constexpr const LogicalTypeId TIME_TZ = LogicalTypeId::TIME_TZ
 
static constexpr const LogicalTypeId VARCHAR = LogicalTypeId::VARCHAR
 
static constexpr const LogicalTypeId ANY = LogicalTypeId::ANY
 
static constexpr const LogicalTypeId BLOB = LogicalTypeId::BLOB
 
static constexpr const LogicalTypeId BIT = LogicalTypeId::BIT
 
static constexpr const LogicalTypeId BIGNUM = LogicalTypeId::BIGNUM
 
static constexpr const LogicalTypeId INTERVAL = LogicalTypeId::INTERVAL
 
static constexpr const LogicalTypeId HUGEINT = LogicalTypeId::HUGEINT
 
static constexpr const LogicalTypeId UHUGEINT = LogicalTypeId::UHUGEINT
 
static constexpr const LogicalTypeId UUID = LogicalTypeId::UUID
 
static constexpr const LogicalTypeId HASH = LogicalTypeId::UBIGINT
 
static constexpr const LogicalTypeId POINTER = LogicalTypeId::POINTER
 
static constexpr const LogicalTypeId TABLE = LogicalTypeId::TABLE
 
static constexpr const LogicalTypeId LAMBDA = LogicalTypeId::LAMBDA
 
static constexpr const LogicalTypeId INVALID = LogicalTypeId::INVALID
 
static constexpr const LogicalTypeId ROW_TYPE = LogicalTypeId::BIGINT
 
static constexpr auto JSON_TYPE_NAME = "JSON"
 The JSON type lives in the JSON extension, but we need to define this here for special handling.
 

Private Member Functions

PhysicalType GetInternalType ()
 

Private Attributes

LogicalTypeId id_
 
PhysicalType physical_type_
 
shared_ptr< ExtraTypeInfotype_info_
 

Member Function Documentation

◆ id()

LogicalTypeId duckdb::LogicalType::id ( ) const
inline
2939 { // NOLINT: mimic std casing
2940 return id_;
2941 }

◆ InternalType()

PhysicalType duckdb::LogicalType::InternalType ( ) const
inline
2942 {
2943 return physical_type_;
2944 }

◆ AuxInfo()

const optional_ptr< ExtraTypeInfo > duckdb::LogicalType::AuxInfo ( ) const
inline
2945 {
2946 return type_info_.get();
2947 }

◆ IsNested()

bool duckdb::LogicalType::IsNested ( ) const
inline
2948 {
2949 auto internal = InternalType();
2950 if (internal == PhysicalType::STRUCT) {
2951 return true;
2952 }
2953 if (internal == PhysicalType::LIST) {
2954 return true;
2955 }
2956 if (internal == PhysicalType::ARRAY) {
2957 return true;
2958 }
2959 return false;
2960 }
@ LIST
A list of some logical data type.
@ STRUCT
Struct of logical types.

◆ IsUnknown()

bool duckdb::LogicalType::IsUnknown ( ) const
inline
2961 {
2962 return id_ == LogicalTypeId::UNKNOWN;
2963 }

◆ IsUnbound()

bool duckdb::LogicalType::IsUnbound ( ) const
inline
2964 {
2965 return id_ == LogicalTypeId::UNBOUND;
2966 }

◆ GetAuxInfoShrPtr()

shared_ptr< ExtraTypeInfo > duckdb::LogicalType::GetAuxInfoShrPtr ( ) const
inline
2968 {
2969 return type_info_;
2970 }

◆ CopyAuxInfo()

void duckdb::LogicalType::CopyAuxInfo ( const LogicalType other)
inline
2977 {
2978 type_info_ = other.type_info_;
2979 }

◆ operator=() [1/2]

LogicalType & duckdb::LogicalType::operator= ( const LogicalType other)
inline
2983 {
2984 if (this == &other) {
2985 return *this;
2986 }
2987 id_ = other.id_;
2988 physical_type_ = other.physical_type_;
2989 type_info_ = other.type_info_;
2990 return *this;
2991 }

◆ operator=() [2/2]

LogicalType & duckdb::LogicalType::operator= ( LogicalType &&  other)
inlinenoexcept
2993 {
2994 id_ = other.id_;
2995 physical_type_ = other.physical_type_;
2996 std::swap(type_info_, other.type_info_);
2997 return *this;
2998 }

◆ operator!=()

bool duckdb::LogicalType::operator!= ( const LogicalType rhs) const
inline
3001 {
3002 return !(*this == rhs);
3003 }

◆ TypeIsTimestamp() [1/2]

static bool duckdb::LogicalType::TypeIsTimestamp ( LogicalTypeId  id)
inlinestatic
3008 {
3009 return (id == LogicalTypeId::TIMESTAMP || id == LogicalTypeId::TIMESTAMP_MS ||
3010 id == LogicalTypeId::TIMESTAMP_NS || id == LogicalTypeId::TIMESTAMP_SEC ||
3011 id == LogicalTypeId::TIMESTAMP_TZ);
3012 }

◆ TypeIsTimestamp() [2/2]

static bool duckdb::LogicalType::TypeIsTimestamp ( const LogicalType type)
inlinestatic
3013 {
3014 return TypeIsTimestamp(type.id());
3015 }

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