QueryResult stores the result of a query execution.
More...
#include <query_result.h>
QueryResult stores the result of a query execution.
◆ QueryResult() [1/3]
| LBUG_API lbug::main::QueryResult::QueryResult |
( |
| ) |
|
Used to create a QueryResult object for the failing query.
◆ QueryResult() [2/3]
◆ QueryResult() [3/3]
◆ ~QueryResult()
| virtual LBUG_API lbug::main::QueryResult::~QueryResult |
( |
| ) |
|
|
pure virtual |
◆ addNextResult()
| void lbug::main::QueryResult::addNextResult |
( |
std::unique_ptr< QueryResult > | next_ | ) |
|
◆ cast()
template<class TARGET>
| TARGET & lbug::main::QueryResult::cast |
( |
| ) |
|
|
inline |
◆ checkDatabaseClosedOrThrow()
| void lbug::main::QueryResult::checkDatabaseClosedOrThrow |
( |
| ) |
const |
|
protected |
◆ constCast()
template<class TARGET>
| const TARGET & lbug::main::QueryResult::constCast |
( |
| ) |
const |
|
inline |
◆ getArrowSchema()
Returns the arrow schema of the query result.
- Returns
- datatypes of the columns as an arrow schema
It is the caller's responsibility to call the release function to release the underlying data If converting to another arrow type, this is usually handled automatically.
◆ getColumnDataTypes()
- Returns
- dataType of each column in the query result.
◆ getColumnNames()
| LBUG_API std::vector< std::string > lbug::main::QueryResult::getColumnNames |
( |
| ) |
const |
- Returns
- name of each column in the query result.
◆ getErrorMessage()
| LBUG_API std::string lbug::main::QueryResult::getErrorMessage |
( |
| ) |
const |
- Returns
- error message of the query execution if the query fails.
◆ getNext()
- Returns
- next flat tuple in the query result. Note that to reduce resource allocation, all calls to getNext() reuse the same FlatTuple object. Since its contents will be overwritten, please complete processing a FlatTuple or make a copy of its data before calling getNext() again.
◆ getNextArrowChunk()
| virtual LBUG_API std::unique_ptr< ArrowArray > lbug::main::QueryResult::getNextArrowChunk |
( |
int64_t | chunkSize | ) |
|
|
pure virtual |
Returns the next chunk of the query result as an arrow array.
- Parameters
-
| chunkSize | number of tuples to return in the chunk. |
- Returns
- An arrow array representation of the next chunkSize tuples of the query result.
The ArrowArray internally stores an arrow struct with fields for each of the columns. This can be converted to a RecordBatch with arrow's ImportRecordBatch function
It is the caller's responsibility to call the release function to release the underlying data If converting to another arrow type, this is usually handled automatically.
◆ getNextQueryResult()
- Returns
- get the next query result to read (for multiple query statements).
◆ getNumColumns()
| LBUG_API size_t lbug::main::QueryResult::getNumColumns |
( |
| ) |
const |
- Returns
- number of columns in query result.
◆ getNumTuples()
| virtual LBUG_API uint64_t lbug::main::QueryResult::getNumTuples |
( |
| ) |
const |
|
pure virtual |
- Returns
- num of tuples in query result.
◆ getQueryResultWithError()
| std::unique_ptr< QueryResult > lbug::main::QueryResult::getQueryResultWithError |
( |
const std::string & | errorMessage | ) |
|
|
static |
◆ getQuerySummary()
- Returns
- query summary which stores the execution time, compiling time, plan and query options.
◆ getQuerySummaryUnsafe()
| QuerySummary * lbug::main::QueryResult::getQuerySummaryUnsafe |
( |
| ) |
|
◆ getType()
◆ hasNext()
| virtual LBUG_API bool lbug::main::QueryResult::hasNext |
( |
| ) |
const |
|
pure virtual |
- Returns
- whether there are more tuples to read.
◆ hasNextArrowChunk()
| virtual LBUG_API bool lbug::main::QueryResult::hasNextArrowChunk |
( |
| ) |
|
|
pure virtual |
- Returns
- whether there are more arrow chunk to read.
◆ hasNextQueryResult()
| LBUG_API bool lbug::main::QueryResult::hasNextQueryResult |
( |
| ) |
const |
- Returns
- whether there are more query results to read.
◆ isSuccess()
| LBUG_API bool lbug::main::QueryResult::isSuccess |
( |
| ) |
const |
- Returns
- if the query is executed successfully or not.
◆ moveNextResult()
| std::unique_ptr< QueryResult > lbug::main::QueryResult::moveNextResult |
( |
| ) |
|
◆ resetIterator()
| virtual LBUG_API void lbug::main::QueryResult::resetIterator |
( |
| ) |
|
|
pure virtual |
Resets the result tuple iterator.
◆ setColumnNames()
| void lbug::main::QueryResult::setColumnNames |
( |
std::vector< std::string > | columnNames | ) |
|
◆ setColumnTypes()
◆ setDBLifeCycleManager()
◆ setQuerySummary()
| void lbug::main::QueryResult::setQuerySummary |
( |
std::unique_ptr< QuerySummary > | summary | ) |
|
◆ toString()
| virtual LBUG_API std::string lbug::main::QueryResult::toString |
( |
| ) |
const |
|
pure virtual |
- Returns
- string of first query result.
◆ validateQuerySucceed()
| void lbug::main::QueryResult::validateQuerySucceed |
( |
| ) |
const |
|
protected |
◆ columnNames
| std::vector<std::string> lbug::main::QueryResult::columnNames |
|
protected |
◆ columnTypes
◆ dbLifeCycleManager
◆ errMsg
| std::string lbug::main::QueryResult::errMsg |
|
protected |
◆ nextQueryResult
| std::unique_ptr<QueryResult> lbug::main::QueryResult::nextQueryResult |
|
protected |
◆ queryResultIterator
◆ querySummary
| std::unique_ptr<QuerySummary> lbug::main::QueryResult::querySummary |
|
protected |
◆ success
| bool lbug::main::QueryResult::success = true |
|
protected |
◆ tuple
◆ type
The documentation for this class was generated from the following file: