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

Public Member Functions

DUCKDB_API ArrowQueryResult (StatementType statement_type, StatementProperties properties, vector< string > names_p, vector< LogicalType > types_p, ClientProperties client_properties, idx_t batch_size)
 Creates a successful query result with the specified names and types.
 
DUCKDB_API ArrowQueryResult (ErrorData error)
 Creates an unsuccessful query result with error condition.
 
DUCKDB_API string ToString () override
 Converts the QueryResult to a string.
 
vector< unique_ptr< ArrowArrayWrapper > > ConsumeArrays ()
 
vector< unique_ptr< ArrowArrayWrapper > > & Arrays ()
 
void SetArrowData (vector< unique_ptr< ArrowArrayWrapper > > arrays)
 
idx_t BatchSize () const
 
- Public Member Functions inherited from duckdb::QueryResult
DUCKDB_API QueryResult (QueryResultType type, StatementType statement_type, StatementProperties properties, vector< LogicalType > types, vector< string > names, ClientProperties client_properties)
 Creates a successful query result with the specified names and types.
 
DUCKDB_API QueryResult (QueryResultType type, ErrorData error)
 Creates an unsuccessful query result with error condition.
 
template<class TARGET >
TARGETCast ()
 
template<class TARGET >
const TARGETCast () const
 
DUCKDB_API const string & ColumnName (idx_t index) const
 Returns the name of the column for the given index.
 
DUCKDB_API unique_ptr< DataChunkFetch ()
 
DUCKDB_API unique_ptr< DataChunkFetchRaw ()
 
virtual DUCKDB_API string ToBox (ClientContext &context, const BoxRendererConfig &config)
 Converts the QueryResult to a box-rendered string.
 
DUCKDB_API void Print ()
 Prints the QueryResult to the console.
 
DUCKDB_API bool Equals (QueryResult &other)
 
bool TryFetch (unique_ptr< DataChunk > &result, ErrorData &error)
 
iterator begin ()
 
iterator end ()
 
- Public Member Functions inherited from duckdb::BaseQueryResult
DUCKDB_API BaseQueryResult (QueryResultType type, StatementType statement_type, StatementProperties properties, vector< LogicalType > types, vector< string > names)
 Creates a successful query result with the specified names and types.
 
DUCKDB_API BaseQueryResult (QueryResultType type, ErrorData error)
 Creates an unsuccessful query result with error condition.
 
DUCKDB_API void ThrowError (const string &prepended_message="") const
 
DUCKDB_API void SetError (ErrorData error)
 
DUCKDB_API bool HasError () const
 
DUCKDB_API const ExceptionType & GetErrorType () const
 
DUCKDB_API const std::string & GetError () const
 
DUCKDB_API ErrorDataGetErrorObject ()
 
DUCKDB_API idx_t ColumnCount ()
 

Static Public Attributes

static constexpr QueryResultType TYPE = QueryResultType::ARROW_RESULT
 

Protected Member Functions

DUCKDB_API unique_ptr< DataChunkFetchInternal () override
 
- Protected Member Functions inherited from duckdb::QueryResult
DUCKDB_API string HeaderToString ()
 

Private Attributes

vector< unique_ptr< ArrowArrayWrapper > > arrays
 
idx_t batch_size
 

Friends

class ClientContext
 

Additional Inherited Members

- Public Types inherited from duckdb::QueryResult
using iterator = QueryResultIterator
 
- Static Public Member Functions inherited from duckdb::QueryResult
static void DeduplicateColumns (vector< string > &names)
 Deduplicate column names for interop with external libraries.
 
- Public Attributes inherited from duckdb::QueryResult
ClientProperties client_properties
 Properties from the client context.
 
unique_ptr< QueryResultnext
 The next result (if any)
 
- Public Attributes inherited from duckdb::BaseQueryResult
QueryResultType type
 The type of the result (MATERIALIZED or STREAMING)
 
StatementType statement_type
 The type of the statement that created this result.
 
StatementProperties properties
 Properties of the statement.
 
vector< LogicalTypetypes
 The SQL types of the result.
 
vector< string > names
 The names of the result.
 
- Protected Attributes inherited from duckdb::BaseQueryResult
bool success
 Whether or not execution was successful.
 
ErrorData error
 The error (in case execution was not successful)
 

Constructor & Destructor Documentation

◆ ArrowQueryResult() [1/2]

duckdb::ArrowQueryResult::ArrowQueryResult ( StatementType  statement_type,
StatementProperties  properties,
vector< string >  names_p,
vector< LogicalType types_p,
ClientProperties  client_properties,
idx_t  batch_size 
)

Creates a successful query result with the specified names and types.

35764 : QueryResult(QueryResultType::ARROW_RESULT, statement_type, std::move(properties), std::move(types_p),
35765 std::move(names_p), std::move(client_properties)),
35766 batch_size(batch_size) {
35767}
StatementProperties properties
Properties of the statement.
Definition duckdb.hpp:19520
StatementType statement_type
The type of the statement that created this result.
Definition duckdb.hpp:19518
DUCKDB_API QueryResult(QueryResultType type, StatementType statement_type, StatementProperties properties, vector< LogicalType > types, vector< string > names, ClientProperties client_properties)
Creates a successful query result with the specified names and types.
ClientProperties client_properties
Properties from the client context.
Definition duckdb.hpp:19555

◆ ArrowQueryResult() [2/2]

duckdb::ArrowQueryResult::ArrowQueryResult ( ErrorData  error)
explicit

Creates an unsuccessful query result with error condition.

35769 : QueryResult(QueryResultType::ARROW_RESULT, std::move(error)) {
35770}
ErrorData error
The error (in case execution was not successful)
Definition duckdb.hpp:19539
Here is the call graph for this function:

Member Function Documentation

◆ ToString()

string duckdb::ArrowQueryResult::ToString ( )
overridevirtual

Converts the QueryResult to a string.

Implements duckdb::QueryResult.

35776 {
35777 // FIXME: can't throw an exception here as it's used for verification
35778 return "";
35779}

◆ ConsumeArrays()

vector< unique_ptr< ArrowArrayWrapper > > duckdb::ArrowQueryResult::ConsumeArrays ( )
35781 {
35782 if (HasError()) {
35783 throw InvalidInputException("Attempting to fetch ArrowArrays from an unsuccessful query result\n: Error %s",
35784 GetError());
35785 }
35786 return std::move(arrays);
35787}

◆ Arrays()

vector< unique_ptr< ArrowArrayWrapper > > & duckdb::ArrowQueryResult::Arrays ( )
35789 {
35790 if (HasError()) {
35791 throw InvalidInputException("Attempting to fetch ArrowArrays from an unsuccessful query result\n: Error %s",
35792 GetError());
35793 }
35794 return arrays;
35795}

◆ SetArrowData()

void duckdb::ArrowQueryResult::SetArrowData ( vector< unique_ptr< ArrowArrayWrapper > >  arrays)
35797 {
35798 D_ASSERT(this->arrays.empty());
35799 this->arrays = std::move(arrays);
35800}

◆ BatchSize()

idx_t duckdb::ArrowQueryResult::BatchSize ( ) const
35802 {
35803 return batch_size;
35804}

◆ FetchInternal()

unique_ptr< DataChunk > duckdb::ArrowQueryResult::FetchInternal ( )
overrideprotectedvirtual

Implements duckdb::QueryResult.

35772 {
35773 throw NotImplementedException("Can't 'FetchRaw' from ArrowQueryResult");
35774}

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