18 #ifndef KUDU_CLIENT_SCHEMA_H
19 #define KUDU_CLIENT_SCHEMA_H
29 #ifdef KUDU_HEADERS_NO_STUBS
30 #include <gtest/gtest_prod.h>
32 #include "kudu/gutil/port.h"
34 #include "kudu/client/stubs.h"
37 #include "kudu/util/kudu_export.h"
43 struct ColumnSchemaDelta;
49 class RemoteKsckCluster;
56 class GetTableSchemaRpc;
98 int8_t precision()
const;
101 int8_t scale()
const;
104 class KUDU_NO_EXPORT Data;
128 DEFAULT_COMPRESSION = 0,
150 int32_t block_size = 0)
151 ATTRIBUTE_DEPRECATED("this constructor will be private in a future release")
152 : encoding_(encoding),
153 compression_(compression),
154 block_size_(block_size) {
168 std::string ToString()
const;
171 EncodingType encoding_;
172 CompressionType compression_;
192 TIMESTAMP = UNIXTIME_MICROS
198 static std::string DataTypeToString(DataType type);
233 const std::string& name()
const;
236 DataType type()
const;
239 bool is_nullable()
const;
248 const std::string& comment()
const;
258 #ifdef KUDU_HEADERS_NO_STUBS
259 FRIEND_TEST(KuduColumnSchemaTest, TestEquals);
264 #if defined(__clang__) || \
265 (defined(__GNUC__) && (__GNUC__ * 10000 + __GNUC_MINOR__ * 100) >= 40600)
266 #pragma GCC diagnostic push
267 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
271 const std::string &name,
273 bool is_nullable =
false,
274 const void* default_value = NULL,
277 const std::string& comment =
"");
278 #if defined(__clang__) || \
279 (defined(__GNUC__) && (__GNUC__ * 10000 + __GNUC_MINOR__ * 100) >= 40600)
280 #pragma GCC diagnostic pop
450 class KUDU_NO_EXPORT Data;
462 Status ToColumnSchemaDelta(ColumnSchemaDelta* col_delta)
const;
464 Slice DefaultValueAsSlice()
const;
525 class KUDU_NO_EXPORT Data;
561 Status Reset(
const std::vector<KuduColumnSchema>& columns,
int key_columns)
562 ATTRIBUTE_DEPRECATED(
"this method will be removed in a future release")
579 size_t num_columns()
const;
589 void GetPrimaryKeyColumnIndexes(std::vector<int>* indexes)
const;
603 std::string ToString()
const;
614 static KuduSchema FromSchema(
const Schema& schema) KUDU_NO_EXPORT;
623 static Schema ToSchema(
const KuduSchema& kudu_schema) KUDU_NO_EXPORT;
628 friend class ClientTest;
637 friend class ScanConfiguration;
638 friend class internal::GetTableSchemaRpc;
639 friend class internal::LookupRpc;
640 friend class internal::MetaCache;
641 friend class internal::MetaCacheEntry;
642 friend class internal::WriteRpc;
643 friend class tools::RemoteKsckCluster;
644 friend class tools::ReplicaDumper;
651 size_t num_key_columns()
const;
659 #endif // KUDU_CLIENT_SCHEMA_H
A representation of a table's schema.
Definition: schema.h:531
Representation of column type attributes.
Definition: schema.h:67
A representation of an operation's outcome.
Definition: status.h:145
A constant cell value with a specific type.
Definition: value.h:35
Representation of column storage attributes.
Definition: schema.h:110
Builder API for specifying or altering a column within a table schema.
Definition: schema.h:295
Representation of the column schema.
Definition: schema.h:177
const EncodingType encoding() const
Definition: schema.h:158
Builds scan tokens for a table.
Definition: client.h:2357
Alters an existing table based on the provided steps.
Definition: client.h:1129
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:147
A handle for a connection to a cluster.
Definition: client.h:319
A wrapper around externally allocated data.
Definition: slice.h:50
A representation of a table on a particular cluster.
Definition: client.h:954
This class is a representation of a single scan.
Definition: client.h:1832
A single-row write operation to be sent to a Kudu table.
Definition: write_op.h:65
CompressionType
Column compression types.
Definition: schema.h:127
Builder API for constructing a KuduSchema object.
Definition: schema.h:491
DataType
Supported data types for columns.
Definition: schema.h:180
A scan descriptor limited to a single physical contiguous location.
Definition: client.h:2297
A helper class to create a new table with the desired options.
Definition: client.h:729
A row which may only contain values for a subset of the columns.
Definition: partial_row.h:68
const CompressionType compression() const
Definition: schema.h:163
EncodingType
Column encoding types.
Definition: schema.h:113