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::SetColumns Struct Reference

This represents the data related to columns that have been set by the user e.g., from a copy command. More...

#include <duckdb.hpp>

Collaboration diagram for duckdb::SetColumns:

Public Member Functions

 SetColumns (const vector< LogicalType > *types_p, const vector< string > *names_p)
bool IsSet () const
 If columns are set.
idx_t Size () const
 How many columns.
bool IsCandidateUnacceptable (const idx_t num_cols, bool null_padding, bool ignore_errors, bool last_value_always_empty) const
 Helper function that checks if candidate is acceptable based on the number of columns it produces.
string ToString () const

Public Attributes

const vector< LogicalType > * types = nullptr
 Return Types that were detected.
const vector< string > * names = nullptr
 Column Names that were detected.

Detailed Description

This represents the data related to columns that have been set by the user e.g., from a copy command.

Constructor & Destructor Documentation

◆ SetColumns() [1/2]

duckdb::SetColumns::SetColumns ( const vector< LogicalType > * types_p,
const vector< string > * names_p )
173293 : types(types_p), names(names_p) {
173294 if (!types) {
173295 D_ASSERT(!types && !names);
173296 } else {
173297 D_ASSERT(types->size() == names->size());
173298 }
173299}
const vector< LogicalType > * types
Return Types that were detected.
Definition duckdb.hpp:51685
const vector< string > * names
Column Names that were detected.
Definition duckdb.hpp:51687

◆ SetColumns() [2/2]

duckdb::SetColumns::SetColumns ( )
173301 {
173302}

Member Function Documentation

◆ IsSet()

bool duckdb::SetColumns::IsSet ( ) const

If columns are set.

173304 {
173305 if (!types) {
173306 return false;
173307 }
173308 return !types->empty();
173309}
Here is the caller graph for this function:

◆ Size()

idx_t duckdb::SetColumns::Size ( ) const

How many columns.

173311 {
173312 if (!types) {
173313 return 0;
173314 }
173315 return types->size();
173316}
Here is the caller graph for this function:

◆ IsCandidateUnacceptable()

bool duckdb::SetColumns::IsCandidateUnacceptable ( const idx_t num_cols,
bool null_padding,
bool ignore_errors,
bool last_value_always_empty ) const

Helper function that checks if candidate is acceptable based on the number of columns it produces.

173319 {
173320 if (!IsSet() || ignore_errors) {
173321 // We can't say its unacceptable if it's not set or if we ignore errors
173322 return false;
173323 }
173324 idx_t size = Size();
173325 // If the columns are set and there is a mismatch with the expected number of columns, with null_padding and
173326 // ignore_errors not set, we don't have a suitable candidate.
173327 // Note that we compare with max_columns_found + 1, because some broken files have the behaviour where two
173328 // columns are represented as: | col 1 | col_2 |
173329 if (num_cols == size || num_cols == size + last_value_always_empty) {
173330 // Good Candidate
173331 return false;
173332 }
173333 // if we detected more columns than we have set, it's all good because we can null-pad them
173334 if (null_padding && num_cols > size) {
173335 return false;
173336 }
173337 // Unacceptable
173338 return true;
173339}
GOpaque< Size > size(const GMat &src)
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
idx_t Size() const
How many columns.
Definition duckdb.cpp:173311
bool IsSet() const
If columns are set.
Definition duckdb.cpp:173304
Here is the call graph for this function:

◆ ToString()

string duckdb::SetColumns::ToString ( ) const
173341 {
173342 stringstream ss;
173343 ss << "columns = { ";
173344 for (idx_t i = 0; i < Size(); ++i) {
173345 ss << "'" << names->at(i) << "'"
173346 << " : ";
173347 ss << "'" << types->at(i).ToString() << "'";
173348 if (i != Size() - 1) {
173349 ss << ", ";
173350 }
173351 }
173352 ss << "}";
173353 return ss.str();
173354}

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