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

Public Member Functions

 MultiFileColumnDefinition (const string &name, const LogicalType &type)
 
 MultiFileColumnDefinition (const MultiFileColumnDefinition &other)
 
MultiFileColumnDefinitionoperator= (const MultiFileColumnDefinition &other)
 
int32_t GetIdentifierFieldId () const
 
string GetIdentifierName () const
 
Value GetDefaultValue () const
 

Static Public Member Functions

static MultiFileColumnDefinition CreateFromNameAndType (const string &name, const LogicalType &type)
 
static vector< MultiFileColumnDefinitionColumnsFromNamesAndTypes (const vector< string > &names, const vector< LogicalType > &types)
 
static void ExtractNamesAndTypes (const vector< MultiFileColumnDefinition > &columns, vector< string > &names, vector< LogicalType > &types)
 

Public Attributes

string name
 
LogicalType type
 
vector< MultiFileColumnDefinitionchildren
 
unique_ptr< ParsedExpressiondefault_expression
 
Value identifier
 Either the field_id or the name to map on.
 

Constructor & Destructor Documentation

◆ MultiFileColumnDefinition() [1/2]

duckdb::MultiFileColumnDefinition::MultiFileColumnDefinition ( const string &  name,
const LogicalType type 
)
inline
53364 : name(name), type(type) {
53365 }

◆ MultiFileColumnDefinition() [2/2]

duckdb::MultiFileColumnDefinition::MultiFileColumnDefinition ( const MultiFileColumnDefinition other)
inline
53368 : name(other.name), type(other.type), children(other.children),
53369 default_expression(other.default_expression ? other.default_expression->Copy() : nullptr),
53370 identifier(other.identifier) {
53371 }
Value identifier
Either the field_id or the name to map on.
Definition duckdb.cpp:53449

Member Function Documentation

◆ operator=()

MultiFileColumnDefinition & duckdb::MultiFileColumnDefinition::operator= ( const MultiFileColumnDefinition other)
inline
53373 {
53374 if (this != &other) {
53375 name = other.name;
53376 type = other.type;
53377 children = other.children;
53378 default_expression = other.default_expression ? other.default_expression->Copy() : nullptr;
53379 identifier = other.identifier;
53380 }
53381 return *this;
53382 }

◆ CreateFromNameAndType()

static MultiFileColumnDefinition duckdb::MultiFileColumnDefinition::CreateFromNameAndType ( const string &  name,
const LogicalType type 
)
inlinestatic
53385 {
53386 MultiFileColumnDefinition result(name, type);
53387 if (type.id() == LogicalTypeId::STRUCT) {
53388 // recursively create for children
53389 for (auto &child_entry : StructType::GetChildTypes(type)) {
53390 result.children.push_back(CreateFromNameAndType(child_entry.first, child_entry.second));
53391 }
53392 }
53393 return result;
53394 }

◆ ColumnsFromNamesAndTypes()

static vector< MultiFileColumnDefinition > duckdb::MultiFileColumnDefinition::ColumnsFromNamesAndTypes ( const vector< string > &  names,
const vector< LogicalType > &  types 
)
inlinestatic
53397 {
53398 vector<MultiFileColumnDefinition> columns;
53399 D_ASSERT(names.size() == types.size());
53400 for (idx_t i = 0; i < names.size(); i++) {
53401 auto &name = names[i];
53402 auto &type = types[i];
53403 columns.push_back(CreateFromNameAndType(name, type));
53404 }
53405 return columns;
53406 }

◆ ExtractNamesAndTypes()

static void duckdb::MultiFileColumnDefinition::ExtractNamesAndTypes ( const vector< MultiFileColumnDefinition > &  columns,
vector< string > &  names,
vector< LogicalType > &  types 
)
inlinestatic
53409 {
53410 D_ASSERT(names.empty());
53411 D_ASSERT(types.empty());
53412 for (auto &column : columns) {
53413 names.push_back(column.name);
53414 types.push_back(column.type);
53415 }
53416 }

◆ GetIdentifierFieldId()

int32_t duckdb::MultiFileColumnDefinition::GetIdentifierFieldId ( ) const
inline
53418 {
53419 D_ASSERT(!identifier.IsNull());
53420 D_ASSERT(identifier.type().id() == LogicalTypeId::INTEGER);
53421 return identifier.GetValue<int32_t>();
53422 }
::int32_t int32_t

◆ GetIdentifierName()

string duckdb::MultiFileColumnDefinition::GetIdentifierName ( ) const
inline
53424 {
53425 if (identifier.IsNull()) {
53426 // No identifier was provided, assume the name as the identifier
53427 return name;
53428 }
53429 D_ASSERT(identifier.type().id() == LogicalTypeId::VARCHAR);
53430 return identifier.GetValue<string>();
53431 }

◆ GetDefaultValue()

Value duckdb::MultiFileColumnDefinition::GetDefaultValue ( ) const
inline
53433 {
53434 D_ASSERT(default_expression);
53435 if (default_expression->type != ExpressionType::VALUE_CONSTANT) {
53436 throw NotImplementedException("Default expression that isn't constant is not supported yet");
53437 }
53438 auto &constant_expr = default_expression->Cast<ConstantExpression>();
53439 return constant_expr.value;
53440 }

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