18 #ifndef KUDU_CLIENT_SCHEMA_H 19 #define KUDU_CLIENT_SCHEMA_H 24 #include "kudu/client/value.h" 25 #include "kudu/util/kudu_export.h" 30 struct ColumnSchemaDelta;
36 class RemoteKsckMaster;
44 class GetTableSchemaRpc;
52 class KuduSchemaBuilder;
53 class KuduWriteOperation;
74 DEFAULT_COMPRESSION = 0,
96 int32_t block_size = 0)
97 ATTRIBUTE_DEPRECATED("this constructor will be private in a future release")
98 : encoding_(encoding),
99 compression_(compression),
100 block_size_(block_size) {
114 std::string ToString()
const;
137 TIMESTAMP = UNIXTIME_MICROS
143 static std::string DataTypeToString(
DataType type);
163 bool is_nullable =
false,
164 const void* default_value = NULL,
201 const std::
string& name() const;
207 bool is_nullable() const;
232 class KUDU_EXPORT KuduColumnSpec {
245 KuduColumnSpec* Default(
KuduValue* value);
282 KuduColumnSpec* BlockSize(int32_t block_size);
296 KuduColumnSpec* PrimaryKey();
303 KuduColumnSpec* NotNull();
310 KuduColumnSpec* Nullable();
331 KuduColumnSpec* RemoveDefault();
338 KuduColumnSpec* RenameTo(
const std::string& new_name);
342 class KUDU_NO_EXPORT Data;
343 friend class KuduSchemaBuilder;
344 friend class KuduTableAlterer;
350 explicit KuduColumnSpec(
const std::string& col_name);
354 Status ToColumnSchemaDelta(ColumnSchemaDelta* col_delta)
const;
356 Slice DefaultValueAsSlice()
const;
417 class KUDU_NO_EXPORT Data;
453 Status Reset(
const std::vector<KuduColumnSchema>& columns,
int key_columns)
454 ATTRIBUTE_DEPRECATED(
"this method will be removed in a future release")
471 size_t num_columns()
const;
481 void GetPrimaryKeyColumnIndexes(std::vector<int>* indexes)
const;
493 friend class ClientTest;
502 friend class ScanConfiguration;
503 friend class internal::GetTableSchemaRpc;
504 friend class internal::LookupRpc;
505 friend class internal::MetaCacheEntry;
506 friend class internal::WriteRpc;
507 friend class tools::RemoteKsckMaster;
508 friend class tools::ReplicaDumper;
510 friend KuduSchema KuduSchemaFromSchema(
const Schema& schema);
518 size_t num_key_columns()
const;
526 #endif // KUDU_CLIENT_SCHEMA_H A representation of a table's schema.
Definition: schema.h:423
A representation of an operation's outcome.
Definition: status.h:130
A constant cell value with a specific type.
Definition: value.h:33
Definition: callbacks.h:28
Representation of column storage attributes.
Definition: schema.h:56
Builder API for specifying or altering a column within a table schema.
Definition: schema.h:232
Representation of the column schema.
Definition: schema.h:123
const EncodingType encoding() const
Definition: schema.h:104
Builds scan tokens for a table.
Definition: client.h:2173
Alters an existing table based on the provided steps.
Definition: client.h:1018
KuduColumnStorageAttributes(EncodingType encoding=AUTO_ENCODING, CompressionType compression=DEFAULT_COMPRESSION, int32_t block_size=0) ATTRIBUTE_DEPRECATED("this const ructor will be private in a future release")
Definition: schema.h:93
A handle for a connection to a cluster.
Definition: client.h:289
A wrapper around externally allocated data.
Definition: slice.h:43
A representation of a table on a particular cluster.
Definition: client.h:862
This class is a representation of a single scan.
Definition: client.h:1695
A single-row write operation to be sent to a Kudu table.
Definition: write_op.h:56
CompressionType
Column compression types.
Definition: schema.h:73
Builder API for constructing a KuduSchema object.
Definition: schema.h:383
DataType
Supported data types for columns.
Definition: schema.h:126
A scan descriptor limited to a single physical contiguous location.
Definition: client.h:2113
A helper class to create a new table with the desired options.
Definition: client.h:646
A row which may only contain values for a subset of the columns.
Definition: partial_row.h:61
const CompressionType compression() const
Definition: schema.h:109
EncodingType
Column encoding types.
Definition: schema.h:59