GPUdb C++ API  Version 7.2.3.0
gpudb::ExecuteSqlRequest Struct Reference

A set of parameters for GPUdb::executeSql. More...

#include <gpudb/protocol/execute_sql.h>

Public Member Functions

 ExecuteSqlRequest ()
 Constructs an ExecuteSqlRequest object with default parameters. More...
 
 ExecuteSqlRequest (const std::string &statement_, const int64_t offset_, const int64_t limit_, const std::string &requestSchemaStr_, const std::vector< std::vector< uint8_t > > &data_, const std::map< std::string, std::string > &options_)
 Constructs an ExecuteSqlRequest object with the specified parameters. More...
 
 ExecuteSqlRequest (const std::string &statement_, const int64_t offset_, const int64_t limit_, const std::string &encoding_, const std::string &requestSchemaStr_, const std::vector< std::vector< uint8_t > > &data_, const std::map< std::string, std::string > &options_)
 Constructs an ExecuteSqlRequest object with the specified parameters. More...
 

Public Attributes

std::string statement
 SQL statement (query, DML, or DDL) to be executed. More...
 
int64_t offset
 A positive integer indicating the number of initial results to skip (this can be useful for paging through the results). More...
 
int64_t limit
 A positive integer indicating the maximum number of results to be returned, or END_OF_SET (-9999) to indicate that the maximum number of results allowed by the server should be returned. More...
 
std::string encoding
 Specifies the encoding for returned records; either 'binary' or 'json'. More...
 
std::string requestSchemaStr
 Avro schema of data. More...
 
std::vector< std::vector< uint8_t > > data
 An array of binary-encoded data for the records to be binded to the SQL query. More...
 
std::map< std::string, std::string > options
 Optional parameters. More...
 

Detailed Description

A set of parameters for GPUdb::executeSql.

Execute a SQL statement (query, DML, or DDL).

See SQL Support for the complete set of supported SQL commands.

When a caller wants all the results from a large query (e.g., more than max_get_records_size records), they can make multiple calls to this endpoint using the offset and limit parameters to page through the results. Normally, this will execute the statement query each time. To avoid re-executing the query each time and to keep the results in the same order, the caller should specify a paging_table name to hold the results of the query between calls and specify the paging_table on subsequent calls. When this is done, the caller should clear the paging table and any other tables in the result_table_list (both returned in the response) when they are done paging through the results. pagingTable (and result_table_list) will be empty if no paging table was created (e.g., when all the query results were returned in the first call).

Definition at line 41 of file execute_sql.h.

Constructor & Destructor Documentation

◆ ExecuteSqlRequest() [1/3]

gpudb::ExecuteSqlRequest::ExecuteSqlRequest ( )
inline

Constructs an ExecuteSqlRequest object with default parameters.

Definition at line 46 of file execute_sql.h.

◆ ExecuteSqlRequest() [2/3]

gpudb::ExecuteSqlRequest::ExecuteSqlRequest ( const std::string &  statement_,
const int64_t  offset_,
const int64_t  limit_,
const std::string &  requestSchemaStr_,
const std::vector< std::vector< uint8_t > > &  data_,
const std::map< std::string, std::string > &  options_ 
)
inline

Constructs an ExecuteSqlRequest object with the specified parameters.

Parameters
[in]statement_SQL statement (query, DML, or DDL) to be executed
[in]offset_A positive integer indicating the number of initial results to skip (this can be useful for paging through the results). The default value is 0. The minimum allowed value is 0. The maximum allowed value is MAX_INT.
[in]limit_A positive integer indicating the maximum number of results to be returned, or END_OF_SET (-9999) to indicate that the maximum number of results allowed by the server should be returned. The number of records returned will never exceed the server's own limit, defined by the max_get_records_size parameter in the server configuration. Use hasMoreRecords to see if more records exist in the result to be fetched, and offset_ & limit_ to request subsequent pages of results. The default value is -9999.
[in]requestSchemaStr_Avro schema of data_. The default value is ''.
[in]data_An array of binary-encoded data for the records to be binded to the SQL query. Or use query_parameters to pass the data in JSON format. The default value is an empty vector.
[in]options_Optional parameters. The default value is an empty map.

Definition at line 453 of file execute_sql.h.

◆ ExecuteSqlRequest() [3/3]

gpudb::ExecuteSqlRequest::ExecuteSqlRequest ( const std::string &  statement_,
const int64_t  offset_,
const int64_t  limit_,
const std::string &  encoding_,
const std::string &  requestSchemaStr_,
const std::vector< std::vector< uint8_t > > &  data_,
const std::map< std::string, std::string > &  options_ 
)
inline

Constructs an ExecuteSqlRequest object with the specified parameters.

Parameters
[in]statement_SQL statement (query, DML, or DDL) to be executed
[in]offset_A positive integer indicating the number of initial results to skip (this can be useful for paging through the results). The default value is 0. The minimum allowed value is 0. The maximum allowed value is MAX_INT.
[in]limit_A positive integer indicating the maximum number of results to be returned, or END_OF_SET (-9999) to indicate that the maximum number of results allowed by the server should be returned. The number of records returned will never exceed the server's own limit, defined by the max_get_records_size parameter in the server configuration. Use hasMoreRecords to see if more records exist in the result to be fetched, and offset_ & limit_ to request subsequent pages of results. The default value is -9999.
[in]encoding_Specifies the encoding for returned records; either 'binary' or 'json'. Supported values: The default value is execute_sql_binary.
[in]requestSchemaStr_Avro schema of data_. The default value is ''.
[in]data_An array of binary-encoded data for the records to be binded to the SQL query. Or use query_parameters to pass the data in JSON format. The default value is an empty vector.
[in]options_Optional parameters. The default value is an empty map.

Definition at line 872 of file execute_sql.h.

Member Data Documentation

◆ data

std::vector<std::vector<uint8_t> > gpudb::ExecuteSqlRequest::data

An array of binary-encoded data for the records to be binded to the SQL query.

Or use query_parameters to pass the data in JSON format. The default value is an empty vector.

Definition at line 934 of file execute_sql.h.

◆ encoding

std::string gpudb::ExecuteSqlRequest::encoding

Specifies the encoding for returned records; either 'binary' or 'json'.

Supported values:

The default value is execute_sql_binary.

Definition at line 921 of file execute_sql.h.

◆ limit

int64_t gpudb::ExecuteSqlRequest::limit

A positive integer indicating the maximum number of results to be returned, or END_OF_SET (-9999) to indicate that the maximum number of results allowed by the server should be returned.

The number of records returned will never exceed the server's own limit, defined by the max_get_records_size parameter in the server configuration. Use hasMoreRecords to see if more records exist in the result to be fetched, and offset & limit to request subsequent pages of results. The default value is -9999.

Definition at line 908 of file execute_sql.h.

◆ offset

int64_t gpudb::ExecuteSqlRequest::offset

A positive integer indicating the number of initial results to skip (this can be useful for paging through the results).

The default value is 0. The minimum allowed value is 0. The maximum allowed value is MAX_INT.

Definition at line 894 of file execute_sql.h.

◆ options

std::map<std::string, std::string> gpudb::ExecuteSqlRequest::options

Optional parameters.

The default value is an empty map.

Definition at line 1183 of file execute_sql.h.

◆ requestSchemaStr

std::string gpudb::ExecuteSqlRequest::requestSchemaStr

Avro schema of data.

The default value is ''.

Definition at line 926 of file execute_sql.h.

◆ statement

std::string gpudb::ExecuteSqlRequest::statement

SQL statement (query, DML, or DDL) to be executed.

Definition at line 886 of file execute_sql.h.


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