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

Public Member Functions

 CreateIndexInfo (const CreateIndexInfo &info)
DUCKDB_API unique_ptr< CreateInfo > Copy () const override
string ToString () const override
void Serialize (Serializer &serializer) const override
vector< string > ExpressionsToList () const
string ExpressionsToString () const
Public Member Functions inherited from duckdb::CreateInfo
 CreateInfo (CatalogType type, string schema=DEFAULT_SCHEMA, string catalog_p=INVALID_CATALOG)
void Serialize (Serializer &serializer) const override
DUCKDB_API void CopyProperties (CreateInfo &other) const
virtual DUCKDB_API unique_ptr< AlterInfo > GetAlterInfo () const
 Generates an alter statement from the create statement - used for OnCreateConflict::ALTER_ON_CONFLICT.
DUCKDB_API string GetCreatePrefix (const string &entry) const
 Returns a string like "CREATE (OR REPLACE) (TEMPORARY) <entry> (IF NOT EXISTS) " for TABLE/VIEW/TYPE/MACRO.
Public Member Functions inherited from duckdb::ParseInfo
 ParseInfo (ParseInfoType info_type)
template<class TARGET>
TARGET & Cast ()
template<class TARGET>
const TARGET & Cast () const

Static Public Member Functions

static unique_ptr< CreateInfo > Deserialize (Deserializer &deserializer)
Static Public Member Functions inherited from duckdb::CreateInfo
static unique_ptr< CreateInfo > Deserialize (Deserializer &deserializer)
Static Public Member Functions inherited from duckdb::ParseInfo
static unique_ptr< ParseInfo > Deserialize (Deserializer &deserializer)
static string QualifierToString (const string &catalog, const string &schema, const string &name)
static string TypeToString (CatalogType type)

Public Attributes

string table
 The table name of the underlying table.
string index_name
 The name of the index.
case_insensitive_map_t< Value > options
 Options values (WITH ...).
string index_type
 The index type (ART, B+-tree, Skip-List, ...).
IndexConstraintType constraint_type
 The index constraint type.
vector< column_t > column_ids
 The column ids of the indexed table.
vector< unique_ptr< ParsedExpression > > expressions
 The set of expressions to index by.
vector< unique_ptr< ParsedExpression > > parsed_expressions
vector< LogicalType > scan_types
 The types of the logical columns (necessary for scanning the table during CREATE INDEX).
vector< string > names
 The names of the logical columns (necessary for scanning the table during CREATE INDEX).
Public Attributes inherited from duckdb::CreateInfo
CatalogType type
 The to-be-created catalog type.
string catalog
 The catalog name of the entry.
string schema
 The schema name of the entry.
OnCreateConflict on_conflict
 What to do on create conflict.
bool temporary
 Whether or not the entry is temporary.
bool internal
 Whether or not the entry is an internal entry.
string sql
 The SQL string of the CREATE statement.
LogicalDependencyList dependencies
 The inherent dependencies of the created entry.
Value comment
 User provided comment.
InsertionOrderPreservingMap< string > tags
 Key-value tags with additional metadata.
Public Attributes inherited from duckdb::ParseInfo
ParseInfoType info_type

Additional Inherited Members

Static Public Attributes inherited from duckdb::CreateInfo
static constexpr const ParseInfoType TYPE = ParseInfoType::CREATE_INFO

Constructor & Destructor Documentation

◆ CreateIndexInfo() [1/2]

duckdb::CreateIndexInfo::CreateIndexInfo ( )
339306 : CreateInfo(CatalogType::INDEX_ENTRY, INVALID_SCHEMA) {
339307}

◆ CreateIndexInfo() [2/2]

duckdb::CreateIndexInfo::CreateIndexInfo ( const CreateIndexInfo & info)
339310 : CreateInfo(CatalogType::INDEX_ENTRY, info.schema), table(info.table), index_name(info.index_name),
339311 options(info.options), index_type(info.index_type), constraint_type(info.constraint_type),
339312 column_ids(info.column_ids), scan_types(info.scan_types), names(info.names) {
339313}
string table
The table name of the underlying table.
Definition duckdb.hpp:49815
string index_type
The index type (ART, B+-tree, Skip-List, ...).
Definition duckdb.hpp:49823
vector< column_t > column_ids
The column ids of the indexed table.
Definition duckdb.hpp:49827
vector< LogicalType > scan_types
The types of the logical columns (necessary for scanning the table during CREATE INDEX).
Definition duckdb.hpp:49833
IndexConstraintType constraint_type
The index constraint type.
Definition duckdb.hpp:49825
string index_name
The name of the index.
Definition duckdb.hpp:49817
vector< string > names
The names of the logical columns (necessary for scanning the table during CREATE INDEX).
Definition duckdb.hpp:49835
case_insensitive_map_t< Value > options
Options values (WITH ...).
Definition duckdb.hpp:49820

Member Function Documentation

◆ Copy()

unique_ptr< CreateInfo > duckdb::CreateIndexInfo::Copy ( ) const
overridevirtual

Implements duckdb::CreateInfo.

339397 {
339398 auto result = make_uniq<CreateIndexInfo>(*this);
339399 CopyProperties(*result);
339400
339401 for (auto &expr : expressions) {
339402 result->expressions.push_back(expr->Copy());
339403 }
339404 for (auto &expr : parsed_expressions) {
339405 result->parsed_expressions.push_back(expr->Copy());
339406 }
339407 return std::move(result);
339408}
vector< unique_ptr< ParsedExpression > > expressions
The set of expressions to index by.
Definition duckdb.hpp:49829

◆ ToString()

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

Reimplemented from duckdb::CreateInfo.

339358 {
339359 string result;
339360
339361 result += "CREATE";
339362 D_ASSERT(constraint_type == IndexConstraintType::UNIQUE || constraint_type == IndexConstraintType::NONE);
339363 if (constraint_type == IndexConstraintType::UNIQUE) {
339364 result += " UNIQUE";
339365 }
339366 result += " INDEX ";
339367 if (on_conflict == OnCreateConflict::IGNORE_ON_CONFLICT) {
339368 result += "IF NOT EXISTS ";
339369 }
339371 result += " ON ";
339372 result += QualifierToString(temporary ? "" : catalog, schema, table);
339373 if (index_type != "ART") {
339374 result += " USING ";
339376 result += " ";
339377 }
339378 result += "(";
339379 result += ExpressionsToString();
339380 result += ")";
339381 if (!options.empty()) {
339382 result += " WITH (";
339383 idx_t i = 0;
339384 for (auto &opt : options) {
339385 result += StringUtil::Format("%s = %s", opt.first, opt.second.ToString());
339386 if (i > 0) {
339387 result += ", ";
339388 }
339389 i++;
339390 }
339391 result += " )";
339392 }
339393 result += ";";
339394 return result;
339395}
static string WriteOptionallyQuoted(const string &text, char quote='"', bool allow_caps = true, KeywordCategory category = KeywordCategory::KEYWORD_NONE)
Writes a string that is optionally quoted + escaped so it can be used as an identifier.
Definition duckdb.cpp:338034
static string Format(const string fmt_str, ARGS... params)
Format a string using printf semantics.
Definition duckdb.hpp:4002
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
bool temporary
Whether or not the entry is temporary.
Definition duckdb.hpp:28166
string catalog
The catalog name of the entry.
Definition duckdb.hpp:28160
OnCreateConflict on_conflict
What to do on create conflict.
Definition duckdb.hpp:28164
string schema
The schema name of the entry.
Definition duckdb.hpp:28162

◆ Serialize()

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

Reimplemented from duckdb::ParseInfo.

415720 {
415721 CreateInfo::Serialize(serializer);
415722 serializer.WritePropertyWithDefault<string>(200, "name", index_name);
415723 serializer.WritePropertyWithDefault<string>(201, "table", table);
415724 /* [Deleted] (DeprecatedIndexType) "index_type" */
415725 serializer.WriteProperty<IndexConstraintType>(203, "constraint_type", constraint_type);
415726 serializer.WritePropertyWithDefault<vector<unique_ptr<ParsedExpression>>>(204, "parsed_expressions", parsed_expressions);
415727 serializer.WritePropertyWithDefault<vector<LogicalType>>(205, "scan_types", scan_types);
415728 serializer.WritePropertyWithDefault<vector<string>>(206, "names", names);
415729 serializer.WritePropertyWithDefault<vector<column_t>>(207, "column_ids", column_ids);
415730 serializer.WritePropertyWithDefault<case_insensitive_map_t<Value>>(208, "options", options);
415731 serializer.WritePropertyWithDefault<string>(209, "index_type_name", index_type);
415732}

◆ Deserialize()

unique_ptr< CreateInfo > duckdb::CreateIndexInfo::Deserialize ( Deserializer & deserializer)
static
415734 {
415735 auto result = duckdb::unique_ptr<CreateIndexInfo>(new CreateIndexInfo());
415736 deserializer.ReadPropertyWithDefault<string>(200, "name", result->index_name);
415737 deserializer.ReadPropertyWithDefault<string>(201, "table", result->table);
415738 deserializer.ReadDeletedProperty<DeprecatedIndexType>(202, "index_type");
415739 deserializer.ReadProperty<IndexConstraintType>(203, "constraint_type", result->constraint_type);
415740 deserializer.ReadPropertyWithDefault<vector<unique_ptr<ParsedExpression>>>(204, "parsed_expressions", result->parsed_expressions);
415741 deserializer.ReadPropertyWithDefault<vector<LogicalType>>(205, "scan_types", result->scan_types);
415742 deserializer.ReadPropertyWithDefault<vector<string>>(206, "names", result->names);
415743 deserializer.ReadPropertyWithDefault<vector<column_t>>(207, "column_ids", result->column_ids);
415744 deserializer.ReadPropertyWithDefault<case_insensitive_map_t<Value>>(208, "options", result->options);
415745 deserializer.ReadPropertyWithDefault<string>(209, "index_type_name", result->index_type);
415746 return std::move(result);
415747}

◆ ExpressionsToList()

vector< string > duckdb::CreateIndexInfo::ExpressionsToList ( ) const
339325 {
339326 vector<string> list;
339327
339328 for (idx_t i = 0; i < parsed_expressions.size(); i++) {
339329 auto &expr = parsed_expressions[i];
339330 auto copy = expr->Copy();
339331
339332 // Column reference expressions are qualified with the table name.
339333 // We need to remove them to reproduce the original query.
339334 RemoveTableQualificationRecursive(copy, table);
339335 bool add_parenthesis = true;
339336 if (copy->GetExpressionType() == ExpressionType::COLUMN_REF) {
339337 auto &column_ref = copy->Cast<ColumnRefExpression>();
339338 if (!column_ref.IsQualified()) {
339339 // Only not qualified references like (col1, col2) don't need parenthesis.
339340 add_parenthesis = false;
339341 }
339342 }
339343
339344 if (add_parenthesis) {
339345 list.push_back(StringUtil::Format("(%s)", copy->ToString()));
339346 } else {
339347 list.push_back(StringUtil::Format("%s", copy->ToString()));
339348 }
339349 }
339350 return list;
339351}

◆ ExpressionsToString()

string duckdb::CreateIndexInfo::ExpressionsToString ( ) const
339353 {
339354 auto list = ExpressionsToList();
339355 return StringUtil::Join(list, ", ");
339356}
static DUCKDB_API string Join(const vector< string > &input, const string &separator)
Join multiple strings into one string. Components are concatenated by the given separator.
Definition duckdb.cpp:109497

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