GPUdb C++ API  Version 5.2.0.0
gpudb::CreateTypeRequest Struct Reference

A set of input parameters for createType(const CreateTypeRequest&) const. More...

#include <gpudb/protocol/create_type.h>

Public Member Functions

 CreateTypeRequest ()
 Constructs a CreateTypeRequest object with default parameter values. More...
 
 CreateTypeRequest (const std::string &typeDefinition, const std::string &label, const std::map< std::string, std::vector< std::string > > &properties, const std::map< std::string, std::string > &options)
 Constructs a CreateTypeRequest object with the specified parameters. More...
 

Public Attributes

std::string typeDefinition
 
std::string label
 
std::map< std::string, std::vector< std::string > > properties
 
std::map< std::string, std::string > options
 

Detailed Description

A set of input parameters for createType(const CreateTypeRequest&) const.

Creates a new type in GPUdb describing the layout or schema of a table. The type definition is a JSON string describing the fields (i.e. columns) of the type. Each field consists of a name and a data type. Supported data types are: double, float, int, long, string, and bytes. In addition one or more properties can be specified for each column which customize the memory usage and query availability of that column. Note that some properties are mutually exclusive–i.e. they cannot be specified for any given column simultaneously. One example of mutually exclusive properties are data and store_only.

To set a primary key on one or more columns include the property 'primary_key' on the desired column_names. If a primary key is specified then GPUdb enforces a uniqueness constraint in that only a single object can exist with a given primary key. When inserting data into a table with a primary key, depending on the parameters in the request, incoming objects with primary keys that match existing objects will either overwrite (i.e. update) the existing object or will be skipped and not added into the set.

Example of a type definition with some of the parameters::

{"type":"record", "name":"point", "fields":[{"name":"msg_id","type":"string"}, {"name":"x","type":"double"}, {"name":"y","type":"double"}, {"name":"TIMESTAMP","type":"double"}, {"name":"source","type":"string"}, {"name":"group_id","type":"string"}, {"name":"OBJECT_ID","type":"string"}] }

Properties::

{"group_id":["store_only"], "msg_id":["store_only","text_search"] }

Definition at line 55 of file create_type.h.

Constructor & Destructor Documentation

gpudb::CreateTypeRequest::CreateTypeRequest ( )
inline

Constructs a CreateTypeRequest object with default parameter values.

Definition at line 61 of file create_type.h.

gpudb::CreateTypeRequest::CreateTypeRequest ( const std::string &  typeDefinition,
const std::string &  label,
const std::map< std::string, std::vector< std::string > > &  properties,
const std::map< std::string, std::string > &  options 
)
inline

Constructs a CreateTypeRequest object with the specified parameters.

Parameters
[in]typeDefinitiona JSON string describing the columns of the type to be registered.
[in]labelA user-defined description string which can be used to differentiate between tables and types with otherwise identical schemas.
[in]propertiesEach key-value pair specifies the properties to use for a given column where the key is the column name. All keys used must be relevant column names for the given table. Specifying any property overrides the default properties for that column (which is based on the column's data type). Default value is an empty std::map.
[in]optionsOptional parameters. Default value is an empty std::map.

Definition at line 89 of file create_type.h.

Member Data Documentation

std::string gpudb::CreateTypeRequest::label

Definition at line 98 of file create_type.h.

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

Definition at line 100 of file create_type.h.

std::map<std::string, std::vector<std::string> > gpudb::CreateTypeRequest::properties

Definition at line 99 of file create_type.h.

std::string gpudb::CreateTypeRequest::typeDefinition

Definition at line 97 of file create_type.h.


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