17 #ifndef KUDU_COMMON_PARTIAL_ROW_H 18 #define KUDU_COMMON_PARTIAL_ROW_H 26 #ifdef KUDU_HEADERS_NO_STUBS 27 #include <gtest/gtest_prod.h> 29 #include "kudu/gutil/port.h" 33 #include "kudu/client/stubs.h" 36 #include "kudu/util/int128.h" 37 #include "kudu/util/kudu_export.h" 38 #include "kudu/util/slice.h" 45 class ClientTest_TestProjectionPredicatesFuzz_Test;
46 class KuduWriteOperation;
50 template<
typename KeyTypeWrapper>
struct SliceKeysTestSetup;
51 template<
typename KeyTypeWrapper>
struct IntKeysTestSetup;
55 template<
typename KeyTypeWrapper>
struct SliceTypeRowOps;
56 template<
typename KeyTypeWrapper>
struct NumTypeRowOps;
105 Status SetBool(
const Slice& col_name,
bool val) WARN_UNUSED_RESULT;
107 Status SetInt8(
const Slice& col_name, int8_t val) WARN_UNUSED_RESULT;
108 Status SetInt16(
const Slice& col_name, int16_t val) WARN_UNUSED_RESULT;
109 Status SetInt32(
const Slice& col_name, int32_t val) WARN_UNUSED_RESULT;
110 Status SetInt64(
const Slice& col_name, int64_t val) WARN_UNUSED_RESULT;
111 Status SetUnixTimeMicros(
const Slice& col_name,
112 int64_t micros_since_utc_epoch) WARN_UNUSED_RESULT;
113 Status SetDate(
const Slice& col_name,
114 int32_t days_since_unix_epoch) WARN_UNUSED_RESULT;
116 Status SetFloat(
const Slice& col_name,
float val) WARN_UNUSED_RESULT;
117 Status SetDouble(
const Slice& col_name,
double val) WARN_UNUSED_RESULT;
118 #if KUDU_INT128_SUPPORTED 119 Status SetUnscaledDecimal(
const Slice& col_name, int128_t val) WARN_UNUSED_RESULT;
139 Status SetBool(
int col_idx,
bool val) WARN_UNUSED_RESULT;
141 Status SetInt8(
int col_idx, int8_t val) WARN_UNUSED_RESULT;
142 Status SetInt16(
int col_idx, int16_t val) WARN_UNUSED_RESULT;
143 Status SetInt32(
int col_idx, int32_t val) WARN_UNUSED_RESULT;
144 Status SetInt64(
int col_idx, int64_t val) WARN_UNUSED_RESULT;
145 Status SetUnixTimeMicros(
int col_idx, int64_t micros_since_utc_epoch) WARN_UNUSED_RESULT;
146 Status SetDate(
int col_idx, int32_t days_since_unix_epoch) WARN_UNUSED_RESULT;
148 Status SetFloat(
int col_idx,
float val) WARN_UNUSED_RESULT;
149 Status SetDouble(
int col_idx,
double val) WARN_UNUSED_RESULT;
150 #if KUDU_INT128_SUPPORTED 151 Status SetUnscaledDecimal(
int col_idx, int128_t val) WARN_UNUSED_RESULT;
172 Status SetBinary(
const Slice& col_name,
const Slice& val) WARN_UNUSED_RESULT;
173 Status SetString(
const Slice& col_name,
const Slice& val) WARN_UNUSED_RESULT;
187 Status SetVarchar(
const Slice& col_name,
const Slice& val) WARN_UNUSED_RESULT;
211 Status SetBinary(
int col_idx,
const Slice& val) WARN_UNUSED_RESULT;
212 Status SetString(
int col_idx,
const Slice& val) WARN_UNUSED_RESULT;
231 Status SetVarchar(
int col_idx,
const Slice& val) WARN_UNUSED_RESULT;
245 Status SetBinaryCopy(
const Slice& col_name,
const Slice& val) WARN_UNUSED_RESULT;
246 Status SetStringCopy(
const Slice& col_name,
const Slice& val) WARN_UNUSED_RESULT;
266 Status SetStringCopy(
int col_idx,
const Slice& val) WARN_UNUSED_RESULT;
267 Status SetBinaryCopy(
int col_idx,
const Slice& val) WARN_UNUSED_RESULT;
287 Status SetBinaryNoCopy(
const Slice& col_name,
const Slice& val) WARN_UNUSED_RESULT;
288 Status SetStringNoCopy(
const Slice& col_name,
const Slice& val) WARN_UNUSED_RESULT;
313 Status SetVarcharNoCopyUnsafe(
const Slice& col_name,
const Slice& val) WARN_UNUSED_RESULT;
337 Status SetBinaryNoCopy(
int col_idx,
const Slice& val) WARN_UNUSED_RESULT;
338 Status SetStringNoCopy(
int col_idx,
const Slice& val) WARN_UNUSED_RESULT;
367 Status SetVarcharNoCopyUnsafe(
int col_idx,
const Slice& val) WARN_UNUSED_RESULT;
377 Status SetNull(
const Slice& col_name) WARN_UNUSED_RESULT;
387 Status SetNull(
int col_idx) WARN_UNUSED_RESULT;
396 Status Unset(
const Slice& col_name) WARN_UNUSED_RESULT;
405 Status Unset(
int col_idx) WARN_UNUSED_RESULT;
412 bool IsColumnSet(
const Slice& col_name)
const;
419 bool IsColumnSet(
int col_idx)
const;
426 bool IsNull(
const Slice& col_name)
const;
433 bool IsNull(
int col_idx)
const;
446 Status GetBool(
const Slice& col_name,
bool* val)
const WARN_UNUSED_RESULT;
448 Status GetInt8(
const Slice& col_name, int8_t* val)
const WARN_UNUSED_RESULT;
449 Status GetInt16(
const Slice& col_name, int16_t* val)
const WARN_UNUSED_RESULT;
450 Status GetInt32(
const Slice& col_name, int32_t* val)
const WARN_UNUSED_RESULT;
451 Status GetInt64(
const Slice& col_name, int64_t* val)
const WARN_UNUSED_RESULT;
452 Status GetUnixTimeMicros(
const Slice& col_name, int64_t* micros_since_utc_epoch)
453 const WARN_UNUSED_RESULT;
454 Status GetDate(
const Slice& col_name, int32_t* days_since_unix_epoch)
const WARN_UNUSED_RESULT;
455 Status GetFloat(
const Slice& col_name,
float* val)
const WARN_UNUSED_RESULT;
456 Status GetDouble(
const Slice& col_name,
double* val)
const WARN_UNUSED_RESULT;
457 #if KUDU_INT128_SUPPORTED 459 Status GetUnscaledDecimal(
const Slice& col_name, int128_t* val) WARN_UNUSED_RESULT;
460 Status GetUnscaledDecimal(
const Slice& col_name, int128_t* val)
const WARN_UNUSED_RESULT;
482 Status GetBool(
int col_idx,
bool* val)
const WARN_UNUSED_RESULT;
484 Status GetInt8(
int col_idx, int8_t* val)
const WARN_UNUSED_RESULT;
485 Status GetInt16(
int col_idx, int16_t* val)
const WARN_UNUSED_RESULT;
486 Status GetInt32(
int col_idx, int32_t* val)
const WARN_UNUSED_RESULT;
487 Status GetInt64(
int col_idx, int64_t* val)
const WARN_UNUSED_RESULT;
488 Status GetUnixTimeMicros(
int col_idx, int64_t* micros_since_utc_epoch)
const WARN_UNUSED_RESULT;
489 Status GetDate(
int col_idx, int32_t* days_since_unix_epoch)
const WARN_UNUSED_RESULT;
491 Status GetFloat(
int col_idx,
float* val)
const WARN_UNUSED_RESULT;
492 Status GetDouble(
int col_idx,
double* val)
const WARN_UNUSED_RESULT;
493 #if KUDU_INT128_SUPPORTED 495 Status GetUnscaledDecimal(
int col_idx, int128_t* val) WARN_UNUSED_RESULT;
496 Status GetUnscaledDecimal(
int col_idx, int128_t* val)
const WARN_UNUSED_RESULT;
517 Status GetString(
const Slice& col_name, Slice* val)
const WARN_UNUSED_RESULT;
518 Status GetBinary(
const Slice& col_name, Slice* val)
const WARN_UNUSED_RESULT;
519 Status GetVarchar(
const Slice& col_name, Slice* val)
const WARN_UNUSED_RESULT;
543 Status GetString(
int col_idx, Slice* val)
const WARN_UNUSED_RESULT;
544 Status GetBinary(
int col_idx, Slice* val)
const WARN_UNUSED_RESULT;
545 Status GetVarchar(
int col_idx, Slice* val)
const WARN_UNUSED_RESULT;
563 Status EncodeRowKey(std::string* encoded_key)
const;
571 std::string ToEncodedRowKeyOrDie()
const;
579 bool IsKeySet()
const;
582 bool AllColumnsSet()
const;
589 std::string ToString()
const;
592 const Schema*
schema()
const {
return schema_; }
595 friend class client::KuduWriteOperation;
596 friend class client::internal::WriteRpc;
597 friend class KeyUtilTest;
598 friend class PartitionSchema;
599 friend class RowOperationsPBDecoder;
600 friend class RowOperationsPBEncoder;
601 friend class tools::TableScanner;
602 friend class TestScanSpec;
603 template<
typename KeyTypeWrapper>
friend struct client::SliceKeysTestSetup;
604 template<
typename KeyTypeWrapper>
friend struct client::IntKeysTestSetup;
605 template<
typename KeyTypeWrapper>
friend struct tablet::SliceTypeRowOps;
606 template<
typename KeyTypeWrapper>
friend struct tablet::NumTypeRowOps;
607 FRIEND_TEST(client::ClientTest, TestProjectionPredicatesFuzz);
608 FRIEND_TEST(KeyUtilTest, TestIncrementInt128PrimaryKey);
609 FRIEND_TEST(PartitionPrunerTest, TestIntPartialPrimaryKeyRangePruning);
610 FRIEND_TEST(PartitionPrunerTest, TestPartialPrimaryKeyRangePruning);
611 FRIEND_TEST(PartitionPrunerTest, TestPrimaryKeyRangePruning);
612 FRIEND_TEST(RowOperationsTest, ProjectionTestWholeSchemaSpecified);
613 FRIEND_TEST(RowOperationsTest, TestProjectUpdates);
614 FRIEND_TEST(RowOperationsTest, TestProjectDeletes);
617 Status Set(
const Slice& col_name,
const typename T::cpp_type& val,
621 Status Set(
int col_idx,
const typename T::cpp_type& val,
625 Status Set(int32_t column_idx,
const uint8_t* val);
628 Status Get(
const Slice& col_name,
typename T::cpp_type* val)
const;
631 Status Get(
int col_idx,
typename T::cpp_type* val)
const;
634 Status SetSliceCopy(
const Slice& col_name,
const Slice& val);
637 Status SetSliceCopy(
int col_idx,
const Slice& val);
643 void DeallocateStringIfSet(
int col_idx,
const ColumnSchema& col);
646 void DeallocateOwnedStrings();
648 const Schema* schema_;
653 uint8_t* isset_bitmap_;
658 uint8_t* owned_strings_bitmap_;
Definition: callbacks.h:28
const Schema * schema() const
Definition: partial_row.h:592
A row which may only contain values for a subset of the columns.
Definition: partial_row.h:72