Kudu C++ client API
|
Builder API for constructing a KuduSchema object. More...
#include <schema.h>
Public Member Functions | |
KuduColumnSpec * | AddColumn (const std::string &name) |
KuduSchemaBuilder * | SetPrimaryKey (const std::vector< std::string > &key_col_names) |
Status | Build (KuduSchema *schema) |
Builder API for constructing a KuduSchema object.
The API here is a "fluent" style of programming, such that the resulting code looks somewhat like a SQL "CREATE TABLE" statement. For example:
SQL:
is represented as:
KuduColumnSpec* kudu::client::KuduSchemaBuilder::AddColumn | ( | const std::string & | name | ) |
Add a column with the specified name to the schema.
[in] | name | Name of the column to add. |
Status kudu::client::KuduSchemaBuilder::Build | ( | KuduSchema * | schema | ) |
Build the schema based on current configuration of the builder object.
[out] | schema | The placeholder for the result schema. Upon successful completion, the parameter is reset to the result of this builder: literally, calling KuduSchema::Reset() on the parameter. |
KuduSchemaBuilder* kudu::client::KuduSchemaBuilder::SetPrimaryKey | ( | const std::vector< std::string > & | key_col_names | ) |
Set the primary key of the new Schema based on the given column names.
This may be used to specify a compound primary key.
[in] | key_col_names | Names of the columns to include into the compound primary key. |