Kudu C++ client API
Loading...
Searching...
No Matches
Public Member Functions | List of all members
KuduPartialRow Class Reference

A row which may only contain values for a subset of the columns. More...

#include <partial_row.h>

Public Member Functions

 KuduPartialRow (const Schema *schema)
 
 KuduPartialRow (const KuduPartialRow &other)
 
KuduPartialRowoperator= (KuduPartialRow other)
 
Status SetVarchar (const Slice &col_name, const Slice &val) WARN_UNUSED_RESULT
 
Status SetVarchar (int col_idx, const Slice &val) WARN_UNUSED_RESULT
 
Status SetNull (const Slice &col_name) WARN_UNUSED_RESULT
 
Status SetNull (int col_idx) WARN_UNUSED_RESULT
 
Status Unset (const Slice &col_name) WARN_UNUSED_RESULT
 
Status Unset (int col_idx) WARN_UNUSED_RESULT
 
bool IsColumnSet (const Slice &col_name) const
 
bool IsColumnSet (int col_idx) const
 
bool IsNull (const Slice &col_name) const
 
bool IsNull (int col_idx) const
 
Status EncodeRowKey (std::string *encoded_key) const
 
std::string ToEncodedRowKeyOrDie () const
 
bool IsKeySet () const
 
bool IsNonUniqueKeySet () const
 
bool IsAutoIncrementingColumnSet () const
 
bool AllColumnsSet () const
 
std::string ToString () const
 
const Schema * schema () const
 
Setters for integral type columns by name.
Status SetBool (const Slice &col_name, bool val) WARN_UNUSED_RESULT
 
Status SetInt8 (const Slice &col_name, int8_t val) WARN_UNUSED_RESULT
 
Status SetInt16 (const Slice &col_name, int16_t val) WARN_UNUSED_RESULT
 
Status SetInt32 (const Slice &col_name, int32_t val) WARN_UNUSED_RESULT
 
Status SetInt64 (const Slice &col_name, int64_t val) WARN_UNUSED_RESULT
 
Status SetSerial (const Slice &col_name, uint64_t val) WARN_UNUSED_RESULT
 
Status SetUnixTimeMicros (const Slice &col_name, int64_t micros_since_utc_epoch) WARN_UNUSED_RESULT
 
Status SetDate (const Slice &col_name, int32_t days_since_unix_epoch) WARN_UNUSED_RESULT
 
Status SetFloat (const Slice &col_name, float val) WARN_UNUSED_RESULT
 
Status SetDouble (const Slice &col_name, double val) WARN_UNUSED_RESULT
 
Setters for integral type columns by index.

These setters are the same as corresponding column-name-based setters, but with numeric column indexes. These are faster since they avoid hashmap lookups, so should be preferred in performance-sensitive code (e.g. bulk loaders).

Status SetBool (int col_idx, bool val) WARN_UNUSED_RESULT
 
Status SetInt8 (int col_idx, int8_t val) WARN_UNUSED_RESULT
 
Status SetInt16 (int col_idx, int16_t val) WARN_UNUSED_RESULT
 
Status SetInt32 (int col_idx, int32_t val) WARN_UNUSED_RESULT
 
Status SetInt64 (int col_idx, int64_t val) WARN_UNUSED_RESULT
 
Status SetSerial (int col_idx, uint64_t val) WARN_UNUSED_RESULT
 
Status SetUnixTimeMicros (int col_idx, int64_t micros_since_utc_epoch) WARN_UNUSED_RESULT
 
Status SetDate (int col_idx, int32_t days_since_unix_epoch) WARN_UNUSED_RESULT
 
Status SetFloat (int col_idx, float val) WARN_UNUSED_RESULT
 
Status SetDouble (int col_idx, double val) WARN_UNUSED_RESULT
 
Setters for binary/string columns by name (copying).
Status SetBinary (const Slice &col_name, const Slice &val) WARN_UNUSED_RESULT
 
Status SetString (const Slice &col_name, const Slice &val) WARN_UNUSED_RESULT
 
Status SetBinaryCopy (const Slice &col_name, const Slice &val) WARN_UNUSED_RESULT
 
Status SetStringCopy (const Slice &col_name, const Slice &val) WARN_UNUSED_RESULT
 
Setters for binary/string columns by index (copying).
Status SetBinary (int col_idx, const Slice &val) WARN_UNUSED_RESULT
 
Status SetString (int col_idx, const Slice &val) WARN_UNUSED_RESULT
 
Status SetStringCopy (int col_idx, const Slice &val) WARN_UNUSED_RESULT
 
Status SetBinaryCopy (int col_idx, const Slice &val) WARN_UNUSED_RESULT
 
Setters for binary/string columns by name (non-copying).
Status SetBinaryNoCopy (const Slice &col_name, const Slice &val) WARN_UNUSED_RESULT
 
Status SetStringNoCopy (const Slice &col_name, const Slice &val) WARN_UNUSED_RESULT
 
Advanced/Unstable API

There are no guarantees that the validation performed by these methods for 'val' will not change.

Status SetVarcharNoCopyUnsafe (const Slice &col_name, const Slice &val) WARN_UNUSED_RESULT
 
Status SetVarcharNoCopyUnsafe (int col_idx, const Slice &val) WARN_UNUSED_RESULT
 
Setters for binary/string columns by index (non-copying).
Status SetBinaryNoCopy (int col_idx, const Slice &val) WARN_UNUSED_RESULT
 
Status SetStringNoCopy (int col_idx, const Slice &val) WARN_UNUSED_RESULT
 
Getters for integral type columns by column name.
Status GetBool (const Slice &col_name, bool *val) const WARN_UNUSED_RESULT
 
Status GetInt8 (const Slice &col_name, int8_t *val) const WARN_UNUSED_RESULT
 
Status GetInt16 (const Slice &col_name, int16_t *val) const WARN_UNUSED_RESULT
 
Status GetInt32 (const Slice &col_name, int32_t *val) const WARN_UNUSED_RESULT
 
Status GetInt64 (const Slice &col_name, int64_t *val) const WARN_UNUSED_RESULT
 
Status GetSerial (const Slice &col_name, uint64_t *val) const WARN_UNUSED_RESULT
 
Status GetUnixTimeMicros (const Slice &col_name, int64_t *micros_since_utc_epoch) const WARN_UNUSED_RESULT
 
Status GetDate (const Slice &col_name, int32_t *days_since_unix_epoch) const WARN_UNUSED_RESULT
 
Status GetFloat (const Slice &col_name, float *val) const WARN_UNUSED_RESULT
 
Status GetDouble (const Slice &col_name, double *val) const WARN_UNUSED_RESULT
 
Getters for column of integral type by column index.

These getters are the same as the corresponding column-name-based getters, but with numeric column indexes. These are faster since they avoid hashmap lookups, so should be preferred in performance-sensitive code (e.g. bulk loaders).

Status GetBool (int col_idx, bool *val) const WARN_UNUSED_RESULT
 
Status GetInt8 (int col_idx, int8_t *val) const WARN_UNUSED_RESULT
 
Status GetInt16 (int col_idx, int16_t *val) const WARN_UNUSED_RESULT
 
Status GetInt32 (int col_idx, int32_t *val) const WARN_UNUSED_RESULT
 
Status GetInt64 (int col_idx, int64_t *val) const WARN_UNUSED_RESULT
 
Status GetSerial (int col_idx, uint64_t *val) const WARN_UNUSED_RESULT
 
Status GetUnixTimeMicros (int col_idx, int64_t *micros_since_utc_epoch) const WARN_UNUSED_RESULT
 
Status GetDate (int col_idx, int32_t *days_since_unix_epoch) const WARN_UNUSED_RESULT
 
Status GetFloat (int col_idx, float *val) const WARN_UNUSED_RESULT
 
Status GetDouble (int col_idx, double *val) const WARN_UNUSED_RESULT
 
Getters for string/binary/varchar column by column name.
Status GetString (const Slice &col_name, Slice *val) const WARN_UNUSED_RESULT
 
Status GetBinary (const Slice &col_name, Slice *val) const WARN_UNUSED_RESULT
 
Status GetVarchar (const Slice &col_name, Slice *val) const WARN_UNUSED_RESULT
 
Getters for string/binary/varchar column by column index.
Status GetString (int col_idx, Slice *val) const WARN_UNUSED_RESULT
 
Status GetBinary (int col_idx, Slice *val) const WARN_UNUSED_RESULT
 
Status GetVarchar (int col_idx, Slice *val) const WARN_UNUSED_RESULT
 

Detailed Description

A row which may only contain values for a subset of the columns.

This object contains a normal contiguous row, plus a bitfield indicating which columns have been set. Additionally, this type may optionally own copies of indirect data for variable length columns.

Constructor & Destructor Documentation

◆ KuduPartialRow() [1/2]

KuduPartialRow::KuduPartialRow ( const Schema *  schema)
explicit
Parameters
[in]schemaSchema to use for the row. The given Schema object must remain valid for the lifetime of this row.

◆ KuduPartialRow() [2/2]

KuduPartialRow::KuduPartialRow ( const KuduPartialRow other)

Create a copy of KuduPartialRow instance.

Parameters
[in]otherKuduPartialRow instance to copy from.

Member Function Documentation

◆ AllColumnsSet()

bool KuduPartialRow::AllColumnsSet ( ) const
Returns
true if all column values have been set.

◆ EncodeRowKey()

Status KuduPartialRow::EncodeRowKey ( std::string *  encoded_key) const

Encode a row key.

The result is suitable for use as a tablet split key, an encoded key range, etc.

Precondition
All of the key columns must be set.
Parameters
[out]encoded_keyThe encoded key (i.e. the result of the encoding).
Returns
Operation result status. In particular, this method returns InvalidArgument if not all the key columns are set.

◆ GetBinary() [1/2]

Status KuduPartialRow::GetBinary ( const Slice &  col_name,
Slice *  val 
) const

Get the string/binary/varchar value for a column by its name.

Parameters
[in]col_nameName of the column.
[out]valPointer to the placeholder to put the resulting value. Note that the method does not copy the value. Callers should copy the resulting Slice if necessary.
Returns
Operation result status. Return a bad Status if at least one of the following is true:
  • The type does not match.
  • The value is unset.
  • The value is NULL.

◆ GetBinary() [2/2]

Status KuduPartialRow::GetBinary ( int  col_idx,
Slice *  val 
) const

Get the string/binary/varchar value for a column by its index.

These methods are faster than their name-based counterparts since they use indices to avoid hashmap lookups, so index-based getters should be preferred in performance-sensitive code.

Parameters
[in]col_idxThe index of the column.
[out]valPointer to the placeholder to put the resulting value. Note that the method does not copy the value. Callers should copy the resulting Slice if necessary.
Returns
Operation result status. Return a bad Status if at least one of the following is true:
  • The type does not match.
  • The value is unset.
  • The value is NULL.

◆ GetBool() [1/2]

Status KuduPartialRow::GetBool ( const Slice &  col_name,
bool *  val 
) const

Get value of the column specified by name.

Parameters
[in]col_nameThe name of the column.
[out]valThe value of the column.
Returns
Operation result status. Return a bad Status if at least one of the following is true:
  • The type does not match.
  • The value is unset.
  • The value is NULL.

◆ GetBool() [2/2]

Status KuduPartialRow::GetBool ( int  col_idx,
bool *  val 
) const

Get value of a column of integral type by column index.

Parameters
[in]col_idxThe index of the target column.
[out]valThe value of the target column.
Returns
Operation result status. Return a bad Status if at least one of the following is true:
  • The type does not match.
  • The value is unset.
  • The value is NULL.

◆ GetDate() [1/2]

Status KuduPartialRow::GetDate ( const Slice &  col_name,
int32_t *  days_since_unix_epoch 
) const
Parameters
[in]col_nameThe name of the column.
[out]days_since_unix_epochThe value of the column.
Returns
Operation result status. Return a bad Status if at least one of the following is true:
  • The type does not match.
  • The value is unset.
  • The value is NULL.

◆ GetDate() [2/2]

Status KuduPartialRow::GetDate ( int  col_idx,
int32_t *  days_since_unix_epoch 
) const
Parameters
[in]col_idxThe index of the target column.
[out]days_since_unix_epochThe value of the target column.
Returns
Operation result status. Return a bad Status if at least one of the following is true:
  • The type does not match.
  • The value is unset.
  • The value is NULL.

◆ GetDouble() [1/2]

Status KuduPartialRow::GetDouble ( const Slice &  col_name,
double *  val 
) const

Get value of the column specified by name.

Parameters
[in]col_nameThe name of the column.
[out]valThe value of the column.
Returns
Operation result status. Return a bad Status if at least one of the following is true:
  • The type does not match.
  • The value is unset.
  • The value is NULL.

◆ GetDouble() [2/2]

Status KuduPartialRow::GetDouble ( int  col_idx,
double *  val 
) const

Get value of a column of integral type by column index.

Parameters
[in]col_idxThe index of the target column.
[out]valThe value of the target column.
Returns
Operation result status. Return a bad Status if at least one of the following is true:
  • The type does not match.
  • The value is unset.
  • The value is NULL.

◆ GetFloat() [1/2]

Status KuduPartialRow::GetFloat ( const Slice &  col_name,
float *  val 
) const

Get value of the column specified by name.

Parameters
[in]col_nameThe name of the column.
[out]valThe value of the column.
Returns
Operation result status. Return a bad Status if at least one of the following is true:
  • The type does not match.
  • The value is unset.
  • The value is NULL.

◆ GetFloat() [2/2]

Status KuduPartialRow::GetFloat ( int  col_idx,
float *  val 
) const

Get value of a column of integral type by column index.

Parameters
[in]col_idxThe index of the target column.
[out]valThe value of the target column.
Returns
Operation result status. Return a bad Status if at least one of the following is true:
  • The type does not match.
  • The value is unset.
  • The value is NULL.

◆ GetInt16() [1/2]

Status KuduPartialRow::GetInt16 ( const Slice &  col_name,
int16_t *  val 
) const

Get value of the column specified by name.

Parameters
[in]col_nameThe name of the column.
[out]valThe value of the column.
Returns
Operation result status. Return a bad Status if at least one of the following is true:
  • The type does not match.
  • The value is unset.
  • The value is NULL.

◆ GetInt16() [2/2]

Status KuduPartialRow::GetInt16 ( int  col_idx,
int16_t *  val 
) const

Get value of a column of integral type by column index.

Parameters
[in]col_idxThe index of the target column.
[out]valThe value of the target column.
Returns
Operation result status. Return a bad Status if at least one of the following is true:
  • The type does not match.
  • The value is unset.
  • The value is NULL.

◆ GetInt32() [1/2]

Status KuduPartialRow::GetInt32 ( const Slice &  col_name,
int32_t *  val 
) const

Get value of the column specified by name.

Parameters
[in]col_nameThe name of the column.
[out]valThe value of the column.
Returns
Operation result status. Return a bad Status if at least one of the following is true:
  • The type does not match.
  • The value is unset.
  • The value is NULL.

◆ GetInt32() [2/2]

Status KuduPartialRow::GetInt32 ( int  col_idx,
int32_t *  val 
) const

Get value of a column of integral type by column index.

Parameters
[in]col_idxThe index of the target column.
[out]valThe value of the target column.
Returns
Operation result status. Return a bad Status if at least one of the following is true:
  • The type does not match.
  • The value is unset.
  • The value is NULL.

◆ GetInt64() [1/2]

Status KuduPartialRow::GetInt64 ( const Slice &  col_name,
int64_t *  val 
) const

Get value of the column specified by name.

Parameters
[in]col_nameThe name of the column.
[out]valThe value of the column.
Returns
Operation result status. Return a bad Status if at least one of the following is true:
  • The type does not match.
  • The value is unset.
  • The value is NULL.

◆ GetInt64() [2/2]

Status KuduPartialRow::GetInt64 ( int  col_idx,
int64_t *  val 
) const

Get value of a column of integral type by column index.

Parameters
[in]col_idxThe index of the target column.
[out]valThe value of the target column.
Returns
Operation result status. Return a bad Status if at least one of the following is true:
  • The type does not match.
  • The value is unset.
  • The value is NULL.

◆ GetInt8() [1/2]

Status KuduPartialRow::GetInt8 ( const Slice &  col_name,
int8_t *  val 
) const

Get value of the column specified by name.

Parameters
[in]col_nameThe name of the column.
[out]valThe value of the column.
Returns
Operation result status. Return a bad Status if at least one of the following is true:
  • The type does not match.
  • The value is unset.
  • The value is NULL.

◆ GetInt8() [2/2]

Status KuduPartialRow::GetInt8 ( int  col_idx,
int8_t *  val 
) const

Get value of a column of integral type by column index.

Parameters
[in]col_idxThe index of the target column.
[out]valThe value of the target column.
Returns
Operation result status. Return a bad Status if at least one of the following is true:
  • The type does not match.
  • The value is unset.
  • The value is NULL.

◆ GetSerial() [1/2]

Status KuduPartialRow::GetSerial ( const Slice &  col_name,
uint64_t *  val 
) const

Get value of the column specified by name.

Parameters
[in]col_nameThe name of the column.
[out]valThe value of the column.
Returns
Operation result status. Return a bad Status if at least one of the following is true:
  • The type does not match.
  • The value is unset.
  • The value is NULL.

◆ GetSerial() [2/2]

Status KuduPartialRow::GetSerial ( int  col_idx,
uint64_t *  val 
) const

Get value of a column of integral type by column index.

Parameters
[in]col_idxThe index of the target column.
[out]valThe value of the target column.
Returns
Operation result status. Return a bad Status if at least one of the following is true:
  • The type does not match.
  • The value is unset.
  • The value is NULL.

◆ GetString() [1/2]

Status KuduPartialRow::GetString ( const Slice &  col_name,
Slice *  val 
) const

Get the string/binary/varchar value for a column by its name.

Parameters
[in]col_nameName of the column.
[out]valPointer to the placeholder to put the resulting value. Note that the method does not copy the value. Callers should copy the resulting Slice if necessary.
Returns
Operation result status. Return a bad Status if at least one of the following is true:
  • The type does not match.
  • The value is unset.
  • The value is NULL.

◆ GetString() [2/2]

Status KuduPartialRow::GetString ( int  col_idx,
Slice *  val 
) const

Get the string/binary/varchar value for a column by its index.

These methods are faster than their name-based counterparts since they use indices to avoid hashmap lookups, so index-based getters should be preferred in performance-sensitive code.

Parameters
[in]col_idxThe index of the column.
[out]valPointer to the placeholder to put the resulting value. Note that the method does not copy the value. Callers should copy the resulting Slice if necessary.
Returns
Operation result status. Return a bad Status if at least one of the following is true:
  • The type does not match.
  • The value is unset.
  • The value is NULL.

◆ GetUnixTimeMicros() [1/2]

Status KuduPartialRow::GetUnixTimeMicros ( const Slice &  col_name,
int64_t *  micros_since_utc_epoch 
) const
Parameters
[in]col_nameThe name of the column.
[out]micros_since_utc_epochThe value of the column.
Returns
Operation result status. Return a bad Status if at least one of the following is true:
  • The type does not match.
  • The value is unset.
  • The value is NULL.

◆ GetUnixTimeMicros() [2/2]

Status KuduPartialRow::GetUnixTimeMicros ( int  col_idx,
int64_t *  micros_since_utc_epoch 
) const
Parameters
[in]col_idxThe index of the target column.
[out]micros_since_utc_epochThe value of the target column.
Returns
Operation result status. Return a bad Status if at least one of the following is true:
  • The type does not match.
  • The value is unset.
  • The value is NULL.

◆ GetVarchar() [1/2]

Status KuduPartialRow::GetVarchar ( const Slice &  col_name,
Slice *  val 
) const

Get the string/binary/varchar value for a column by its name.

Parameters
[in]col_nameName of the column.
[out]valPointer to the placeholder to put the resulting value. Note that the method does not copy the value. Callers should copy the resulting Slice if necessary.
Returns
Operation result status. Return a bad Status if at least one of the following is true:
  • The type does not match.
  • The value is unset.
  • The value is NULL.

◆ GetVarchar() [2/2]

Status KuduPartialRow::GetVarchar ( int  col_idx,
Slice *  val 
) const

Get the string/binary/varchar value for a column by its index.

These methods are faster than their name-based counterparts since they use indices to avoid hashmap lookups, so index-based getters should be preferred in performance-sensitive code.

Parameters
[in]col_idxThe index of the column.
[out]valPointer to the placeholder to put the resulting value. Note that the method does not copy the value. Callers should copy the resulting Slice if necessary.
Returns
Operation result status. Return a bad Status if at least one of the following is true:
  • The type does not match.
  • The value is unset.
  • The value is NULL.

◆ IsAutoIncrementingColumnSet()

bool KuduPartialRow::IsAutoIncrementingColumnSet ( ) const
Returns
true if auto-incrementing column has been set for this mutation.

◆ IsColumnSet() [1/2]

bool KuduPartialRow::IsColumnSet ( const Slice &  col_name) const

Check whether the specified column is set for the row.

Parameters
[in]col_nameName of the column.
Returns
true iff the given column has been specified.

◆ IsColumnSet() [2/2]

bool KuduPartialRow::IsColumnSet ( int  col_idx) const

Check whether the specified column is set for the row.

Parameters
[in]col_idxThe index of the column.
Returns
true iff the given column has been specified.

◆ IsKeySet()

bool KuduPartialRow::IsKeySet ( ) const
Returns
true if all key column values have been set for this mutation.

◆ IsNonUniqueKeySet()

bool KuduPartialRow::IsNonUniqueKeySet ( ) const
Returns
true if all non-unique key column values have been set for this mutation.

◆ IsNull() [1/2]

bool KuduPartialRow::IsNull ( const Slice &  col_name) const

Check whether the specified column is NULL for the row.

Parameters
[in]col_nameName of the target column.
Returns
true iff the given column's value is NULL.

◆ IsNull() [2/2]

bool KuduPartialRow::IsNull ( int  col_idx) const

Check whether the specified column is NULL for the row.

Parameters
[in]col_idxThe index of the column.
Returns
true iff the given column's value is NULL.

◆ operator=()

KuduPartialRow & KuduPartialRow::operator= ( KuduPartialRow  other)

Overwrite this KuduPartialRow instance with data from other instance.

Parameters
[in]otherKuduPartialRow instance to assign from.
Returns
Reference to the updated object.

◆ schema()

const Schema * KuduPartialRow::schema ( ) const
inline
Returns
The schema object for the partial row.

◆ SetBinary() [1/2]

Status KuduPartialRow::SetBinary ( const Slice &  col_name,
const Slice &  val 
)

Set the binary/string value for a column by name, copying the specified data immediately.

Note
The copying behavior is new for these methods starting Kudu 0.10. Prior to Kudu 0.10, these methods behaved like KuduPartialRow::SetStringNoCopy() and KuduPartialRow::SetBinaryNoCopy() correspondingly.
Parameters
[in]col_nameName of the target column.
[in]valThe value to set.
Returns
Operation result status.

◆ SetBinary() [2/2]

Status KuduPartialRow::SetBinary ( int  col_idx,
const Slice &  val 
)

Set the binary/string value for a column by index, copying the specified data immediately.

These setters are the same as the corresponding column-name-based setters, but with numeric column indexes. These are faster since they avoid hashmap lookups, so should be preferred in performance-sensitive code (e.g. bulk loaders).

Note
The copying behavior is new for these methods starting Kudu 0.10. Prior to Kudu 0.10, these methods behaved like KuduPartialRow::SetStringNoCopy() and KuduPartialRow::SetBinaryNoCopy() correspondingly.
Parameters
[in]col_idxThe index of the target column.
[in]valThe value to set.
Returns
Operation result status.

◆ SetBinaryCopy() [1/2]

Status KuduPartialRow::SetBinaryCopy ( const Slice &  col_name,
const Slice &  val 
)

Set the binary/string value for a column by name, copying the specified data immediately.

Parameters
[in]col_nameName of the target column.
[in]valThe value to set.
Returns
Operation result status.

◆ SetBinaryCopy() [2/2]

Status KuduPartialRow::SetBinaryCopy ( int  col_idx,
const Slice &  val 
)

Set the binary/string value for a column by index, copying the specified data immediately.

These setters are the same as the corresponding column-name-based setters, but with numeric column indexes. These are faster since they avoid hashmap lookups, so should be preferred in performance-sensitive code (e.g. bulk loaders).

Note
The copying behavior is new for these methods starting Kudu 0.10. Prior to Kudu 0.10, these methods behaved like KuduPartialRow::SetStringNoCopy() and KuduPartialRow::SetBinaryNoCopy() correspondingly.
Parameters
[in]col_idxThe index of the target column.
[in]valThe value to set.
Returns
Operation result status.

◆ SetBinaryNoCopy() [1/2]

Status KuduPartialRow::SetBinaryNoCopy ( const Slice &  col_name,
const Slice &  val 
)

Set the binary/string value for a column by name, not copying the specified data.

Note
The specified data must remain valid until the corresponding RPC calls are completed to be able to access error buffers, if any errors happened (the errors can be fetched using the KuduSession::GetPendingErrors() method).
Parameters
[in]col_nameName of the target column.
[in]valThe value to set.
Returns
Operation result status.

◆ SetBinaryNoCopy() [2/2]

Status KuduPartialRow::SetBinaryNoCopy ( int  col_idx,
const Slice &  val 
)

Set the binary/string value for a column by index, not copying the specified data.

These setters are the same as the corresponding column-name-based setters, but with numeric column indexes. These are faster since they avoid hashmap lookups, so should be preferred in performance-sensitive code (e.g. bulk loaders).

Note
The specified data must remain valid until the corresponding RPC calls are completed to be able to access error buffers, if any errors happened (the errors can be fetched using the KuduSession::GetPendingErrors() method).
Parameters
[in]col_idxThe index of the target column.
[in]valThe value to set.
Returns
Operation result status.

◆ SetBool() [1/2]

Status KuduPartialRow::SetBool ( const Slice &  col_name,
bool  val 
)

Set value for a column by name.

Parameters
[in]col_nameName of the target column.
[in]valThe value to set.
Returns
Operation result status.

◆ SetBool() [2/2]

Status KuduPartialRow::SetBool ( int  col_idx,
bool  val 
)
Parameters
[in]col_idxThe index of the target column.
[in]valThe value to set.
Returns
Operation result status.

◆ SetDate() [1/2]

Status KuduPartialRow::SetDate ( const Slice &  col_name,
int32_t  days_since_unix_epoch 
)

Set value for a column by name.

Parameters
[in]col_nameName of the target column.
[in]days_since_unix_epochThe value to set.
Returns
Operation result status.

◆ SetDate() [2/2]

Status KuduPartialRow::SetDate ( int  col_idx,
int32_t  days_since_unix_epoch 
)
Parameters
[in]col_idxThe index of the target column.
[in]days_since_unix_epochThe value to set.
Returns
Operation result status.

◆ SetDouble() [1/2]

Status KuduPartialRow::SetDouble ( const Slice &  col_name,
double  val 
)

Set value for a column by name.

Parameters
[in]col_nameName of the target column.
[in]valThe value to set.
Returns
Operation result status.

◆ SetDouble() [2/2]

Status KuduPartialRow::SetDouble ( int  col_idx,
double  val 
)
Parameters
[in]col_idxThe index of the target column.
[in]valThe value to set.
Returns
Operation result status.

◆ SetFloat() [1/2]

Status KuduPartialRow::SetFloat ( const Slice &  col_name,
float  val 
)

Set value for a column by name.

Parameters
[in]col_nameName of the target column.
[in]valThe value to set.
Returns
Operation result status.

◆ SetFloat() [2/2]

Status KuduPartialRow::SetFloat ( int  col_idx,
float  val 
)
Parameters
[in]col_idxThe index of the target column.
[in]valThe value to set.
Returns
Operation result status.

◆ SetInt16() [1/2]

Status KuduPartialRow::SetInt16 ( const Slice &  col_name,
int16_t  val 
)

Set value for a column by name.

Parameters
[in]col_nameName of the target column.
[in]valThe value to set.
Returns
Operation result status.

◆ SetInt16() [2/2]

Status KuduPartialRow::SetInt16 ( int  col_idx,
int16_t  val 
)
Parameters
[in]col_idxThe index of the target column.
[in]valThe value to set.
Returns
Operation result status.

◆ SetInt32() [1/2]

Status KuduPartialRow::SetInt32 ( const Slice &  col_name,
int32_t  val 
)

Set value for a column by name.

Parameters
[in]col_nameName of the target column.
[in]valThe value to set.
Returns
Operation result status.

◆ SetInt32() [2/2]

Status KuduPartialRow::SetInt32 ( int  col_idx,
int32_t  val 
)
Parameters
[in]col_idxThe index of the target column.
[in]valThe value to set.
Returns
Operation result status.

◆ SetInt64() [1/2]

Status KuduPartialRow::SetInt64 ( const Slice &  col_name,
int64_t  val 
)

Set value for a column by name.

Parameters
[in]col_nameName of the target column.
[in]valThe value to set.
Returns
Operation result status.

◆ SetInt64() [2/2]

Status KuduPartialRow::SetInt64 ( int  col_idx,
int64_t  val 
)
Parameters
[in]col_idxThe index of the target column.
[in]valThe value to set.
Returns
Operation result status.

◆ SetInt8() [1/2]

Status KuduPartialRow::SetInt8 ( const Slice &  col_name,
int8_t  val 
)

Set value for a column by name.

Parameters
[in]col_nameName of the target column.
[in]valThe value to set.
Returns
Operation result status.

◆ SetInt8() [2/2]

Status KuduPartialRow::SetInt8 ( int  col_idx,
int8_t  val 
)
Parameters
[in]col_idxThe index of the target column.
[in]valThe value to set.
Returns
Operation result status.

◆ SetNull() [1/2]

Status KuduPartialRow::SetNull ( const Slice &  col_name)

Set column value to NULL; the column is identified by its name.

This will only succeed on nullable columns. Use Unset() to restore column value to its default.

Parameters
[in]col_nameName of the target column.
Returns
Operation result status.

◆ SetNull() [2/2]

Status KuduPartialRow::SetNull ( int  col_idx)

Set column value to NULL; the column is identified by its index.

This will only succeed on nullable columns. Use Unset() to restore column value to its default.

Parameters
[in]col_idxThe index of the target column.
Returns
Operation result status.

◆ SetSerial() [1/2]

Status KuduPartialRow::SetSerial ( const Slice &  col_name,
uint64_t  val 
)

Set value for a column by name.

Parameters
[in]col_nameName of the target column.
[in]valThe value to set.
Returns
Operation result status.

◆ SetSerial() [2/2]

Status KuduPartialRow::SetSerial ( int  col_idx,
uint64_t  val 
)
Parameters
[in]col_idxThe index of the target column.
[in]valThe value to set.
Returns
Operation result status.

◆ SetString() [1/2]

Status KuduPartialRow::SetString ( const Slice &  col_name,
const Slice &  val 
)

Set the binary/string value for a column by name, copying the specified data immediately.

Note
The copying behavior is new for these methods starting Kudu 0.10. Prior to Kudu 0.10, these methods behaved like KuduPartialRow::SetStringNoCopy() and KuduPartialRow::SetBinaryNoCopy() correspondingly.
Parameters
[in]col_nameName of the target column.
[in]valThe value to set.
Returns
Operation result status.

◆ SetString() [2/2]

Status KuduPartialRow::SetString ( int  col_idx,
const Slice &  val 
)

Set the binary/string value for a column by index, copying the specified data immediately.

These setters are the same as the corresponding column-name-based setters, but with numeric column indexes. These are faster since they avoid hashmap lookups, so should be preferred in performance-sensitive code (e.g. bulk loaders).

Note
The copying behavior is new for these methods starting Kudu 0.10. Prior to Kudu 0.10, these methods behaved like KuduPartialRow::SetStringNoCopy() and KuduPartialRow::SetBinaryNoCopy() correspondingly.
Parameters
[in]col_idxThe index of the target column.
[in]valThe value to set.
Returns
Operation result status.

◆ SetStringCopy() [1/2]

Status KuduPartialRow::SetStringCopy ( const Slice &  col_name,
const Slice &  val 
)

Set the binary/string value for a column by name, copying the specified data immediately.

Note
The copying behavior is new for these methods starting Kudu 0.10. Prior to Kudu 0.10, these methods behaved like KuduPartialRow::SetStringNoCopy() and KuduPartialRow::SetBinaryNoCopy() correspondingly.
Parameters
[in]col_nameName of the target column.
[in]valThe value to set.
Returns
Operation result status.

◆ SetStringCopy() [2/2]

Status KuduPartialRow::SetStringCopy ( int  col_idx,
const Slice &  val 
)

Set the binary/string value for a column by index, copying the specified data immediately.

These setters are the same as the corresponding column-name-based setters, but with numeric column indexes. These are faster since they avoid hashmap lookups, so should be preferred in performance-sensitive code (e.g. bulk loaders).

Parameters
[in]col_idxThe index of the target column.
[in]valThe value to set.
Returns
Operation result status.

◆ SetStringNoCopy() [1/2]

Status KuduPartialRow::SetStringNoCopy ( const Slice &  col_name,
const Slice &  val 
)

Set the binary/string value for a column by name, not copying the specified data.

Note
The specified data must remain valid until the corresponding RPC calls are completed to be able to access error buffers, if any errors happened (the errors can be fetched using the KuduSession::GetPendingErrors() method).
Parameters
[in]col_nameName of the target column.
[in]valThe value to set.
Returns
Operation result status.

◆ SetStringNoCopy() [2/2]

Status KuduPartialRow::SetStringNoCopy ( int  col_idx,
const Slice &  val 
)

Set the binary/string value for a column by index, not copying the specified data.

These setters are the same as the corresponding column-name-based setters, but with numeric column indexes. These are faster since they avoid hashmap lookups, so should be preferred in performance-sensitive code (e.g. bulk loaders).

Note
The specified data must remain valid until the corresponding RPC calls are completed to be able to access error buffers, if any errors happened (the errors can be fetched using the KuduSession::GetPendingErrors() method).
Parameters
[in]col_idxThe index of the target column.
[in]valThe value to set.
Returns
Operation result status.

◆ SetUnixTimeMicros() [1/2]

Status KuduPartialRow::SetUnixTimeMicros ( const Slice &  col_name,
int64_t  micros_since_utc_epoch 
)

Set value for a column by name.

Parameters
[in]col_nameName of the target column.
[in]micros_since_utc_epochThe value to set.
Returns
Operation result status.

◆ SetUnixTimeMicros() [2/2]

Status KuduPartialRow::SetUnixTimeMicros ( int  col_idx,
int64_t  micros_since_utc_epoch 
)
Parameters
[in]col_idxThe index of the target column.
[in]micros_since_utc_epochThe value to set.
Returns
Operation result status.

◆ SetVarchar() [1/2]

Status KuduPartialRow::SetVarchar ( const Slice &  col_name,
const Slice &  val 
)

Set the varchar value for a column by name, copying the specified data immediately.

Parameters
[in]col_nameName of the target column.
[in]valThe value to set.
Returns
Operation result status.

◆ SetVarchar() [2/2]

Status KuduPartialRow::SetVarchar ( int  col_idx,
const Slice &  val 
)

Set the varchar value for a column by index, copying the specified data immediately.

These setters are the same as the corresponding column-name-based setters, but with numeric column indexes. These are faster since they avoid hashmap lookups, so should be preferred in performance-sensitive code (e.g. bulk loaders).

Parameters
[in]col_idxThe index of the target column.
[in]valThe value to set.
Returns
Operation result status.

◆ SetVarcharNoCopyUnsafe() [1/2]

Status KuduPartialRow::SetVarcharNoCopyUnsafe ( const Slice &  col_name,
const Slice &  val 
)

This method expects the values to be truncated already and they only do a basic validation that the data is not larger than the maximum column length (as indicated by the schema) multiplied by 4, as that's the upper limit if only 4-byte UTF8 characters are used. This is subject to change in the future.

Note
The specified data must remain valid until the corresponding RPC calls are completed to be able to access error buffers, if any errors happened (the errors can be fetched using the KuduSession::GetPendingErrors() method).
Warning
Unstable API
Parameters
[in]col_nameName of the target column.
[in]valThe value to set.
Returns
Operation result status.

◆ SetVarcharNoCopyUnsafe() [2/2]

Status KuduPartialRow::SetVarcharNoCopyUnsafe ( int  col_idx,
const Slice &  val 
)

This method expects the values to be truncated already and they only do a basic validation that the data is not larger than the maximum column length (as indicated by the schema) multiplied by 4, as that's the upper limit if only 4-byte UTF8 characters are used. This is subject to change in the future.

This setter is the same as the corresponding column-name-based setter, but with numeric column indexes. This is faster since it avoids hashmap lookups, so should be preferred in performance-sensitive code (e.g. bulk loaders).

Note
The specified data must remain valid until the corresponding RPC calls are completed to be able to access error buffers, if any errors happened (the errors can be fetched using the KuduSession::GetPendingErrors() method).
Warning
Unstable API
Parameters
[in]col_idxThe index of the target column.
[in]valThe value to set.
Returns
Operation result status.

◆ ToEncodedRowKeyOrDie()

std::string KuduPartialRow::ToEncodedRowKeyOrDie ( ) const

Convenience method which is similar to EncodeRowKey.

This is equivalent to the EncodeRowKey, but triggers a FATAL error on failure.

Returns
The encoded key.

◆ ToString()

std::string KuduPartialRow::ToString ( ) const
Returns
String representation for the partial row.

◆ Unset() [1/2]

Status KuduPartialRow::Unset ( const Slice &  col_name)

Unset the given column by name, restoring its default value.

Note
This is different from setting it to NULL.
Parameters
[in]col_nameName of the target column.
Returns
Operation result status.

◆ Unset() [2/2]

Status KuduPartialRow::Unset ( int  col_idx)

Unset the given column by index, restoring its default value.

Note
This is different from setting it to NULL.
Parameters
[in]col_idxThe index of the target column.
Returns
Operation result status.

The documentation for this class was generated from the following file: