Builder API for specifying or altering a column within a table schema. More...
#include <schema.h>
Public Member Functions | |
KuduColumnSpec * | Default (KuduValue *value) |
KuduColumnSpec * | Compression (KuduColumnStorageAttributes::CompressionType compression) |
KuduColumnSpec * | Encoding (KuduColumnStorageAttributes::EncodingType encoding) |
KuduColumnSpec * | BlockSize (int32_t block_size) |
Operations only relevant for Create Table | |
Set the column to be the primary key of the table. This may only be used to set non-composite primary keys. If a composite key is desired, use KuduSchemaBuilder::SetPrimaryKey(). This may not be used in conjunction with KuduSchemaBuilder::SetPrimaryKey().
| |
KuduColumnSpec * | PrimaryKey () |
KuduColumnSpec * | NotNull () |
KuduColumnSpec * | Nullable () |
KuduColumnSpec * | Type (KuduColumnSchema::DataType type) |
Operations only relevant for Alter Table | |
KuduColumnSpec * | RemoveDefault () |
KuduColumnSpec * | RenameTo (const std::string &new_name) |
Friends | |
class | KuduSchemaBuilder |
class | KuduTableAlterer |
Builder API for specifying or altering a column within a table schema.
An object of this type cannot be constructed directly, but rather is returned from KuduSchemaBuilder::AddColumn() to specify a column within a Schema.
KuduColumnSpec* kudu::client::KuduColumnSpec::BlockSize | ( | int32_t | block_size | ) |
Set the target block size for the column.
This is the number of bytes of user data packed per block on disk, and represents the unit of IO when reading the column. Larger values may improve scan performance, particularly on spinning media. Smaller values may improve random access performance, particularly for workloads that have high cache hit rates or operate on fast storage such as SSD.
[in] | block_size | Block size (in bytes) to use. |
KuduColumnSpec* kudu::client::KuduColumnSpec::Compression | ( | KuduColumnStorageAttributes::CompressionType | compression | ) |
Set the preferred compression type for the column.
[in] | compression | The compression type to use. |
KuduColumnSpec* kudu::client::KuduColumnSpec::Default | ( | KuduValue * | value | ) |
Set the default value for the column.
When adding a new column to a table, this default value will be used to fill the new column in all existing rows. The default value will also be used when inserting a new row with no value for the column.
[in] | value | The value to use as the default. The KuduColumnSpec takes ownership over the passed parameter. |
KuduColumnSpec* kudu::client::KuduColumnSpec::Encoding | ( | KuduColumnStorageAttributes::EncodingType | encoding | ) |
Set the preferred encoding for the column.
[in] | encoding | The encoding to use. |
KuduColumnSpec* kudu::client::KuduColumnSpec::NotNull | ( | ) |
Set the column to be not nullable.
KuduColumnSpec* kudu::client::KuduColumnSpec::Nullable | ( | ) |
Set the column to be nullable (the default).
KuduColumnSpec* kudu::client::KuduColumnSpec::RenameTo | ( | const std::string & | new_name | ) |
Rename the column.
[in] | new_name | The new name for the column. |
KuduColumnSpec* kudu::client::KuduColumnSpec::Type | ( | KuduColumnSchema::DataType | type | ) |
Set the data type of the column.
[in] | type | The data type to set. |