Kudu C++ client API
Loading...
Searching...
No Matches
kudu::client::KuduScanBatch::RowPtr Class Reference

A handle for a single row in KuduScanBatch. More...

#include <scan_batch.h>

Public Member Functions

 RowPtr ()
const RowPtroperator-> () const
bool IsNull (const Slice &col_name) const
bool IsNull (int col_idx) const
Status IsDeleted (bool *val) const WARN_UNUSED_RESULT KUDU_NO_EXPORT
const void * cell (int col_idx) const
std::string ToString () const
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 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 integral type columns by column index.

These methods are faster than their name-based counterparts since using indices avoids a hashmap lookup, so index-based getters should be preferred in performance-sensitive code.

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 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 handle for a single row in KuduScanBatch.

Constructor & Destructor Documentation

◆ RowPtr()

kudu::client::KuduScanBatch::RowPtr::RowPtr ( )
inline

Construct an invalid RowPtr. Before use, you must assign a properly-initialized value.

Member Function Documentation

◆ cell()

const void * kudu::client::KuduScanBatch::RowPtr::cell ( int col_idx) const

Get the column's row data.

Note
Should be avoided unless absolutely necessary.
Parameters
[in]col_idxThe index of the column.
Returns
Raw cell data for the specified index.

◆ GetBinary() [1/2]

Status kudu::client::KuduScanBatch::RowPtr::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 kudu::client::KuduScanBatch::RowPtr::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 using indices avoids a hashmap lookup, 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 kudu::client::KuduScanBatch::RowPtr::GetBool ( const Slice & col_name,
bool * val ) const
Parameters
[in]col_nameThe name of the target column.
[out]valPlaceholder for the result value.
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 kudu::client::KuduScanBatch::RowPtr::GetBool ( int col_idx,
bool * val ) const
Parameters
[in]col_idxThe index of the column.
[out]valPointer to the placeholder to put the resulting value.
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 kudu::client::KuduScanBatch::RowPtr::GetDate ( const Slice & col_name,
int32_t * days_since_unix_epoch ) const
Parameters
[in]col_nameThe name of the target column.
[out]days_since_unix_epochPlaceholder for the result value.
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 kudu::client::KuduScanBatch::RowPtr::GetDate ( int col_idx,
int32_t * days_since_unix_epoch ) const
Parameters
[in]col_idxThe index of the column.
[out]days_since_unix_epochPointer to the placeholder to put the resulting value.
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 kudu::client::KuduScanBatch::RowPtr::GetDouble ( const Slice & col_name,
double * val ) const
Parameters
[in]col_nameThe name of the target column.
[out]valPlaceholder for the result value.
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 kudu::client::KuduScanBatch::RowPtr::GetDouble ( int col_idx,
double * val ) const
Parameters
[in]col_idxThe index of the column.
[out]valPointer to the placeholder to put the resulting value.
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 kudu::client::KuduScanBatch::RowPtr::GetFloat ( const Slice & col_name,
float * val ) const
Parameters
[in]col_nameThe name of the target column.
[out]valPlaceholder for the result value.
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 kudu::client::KuduScanBatch::RowPtr::GetFloat ( int col_idx,
float * val ) const
Parameters
[in]col_idxThe index of the column.
[out]valPointer to the placeholder to put the resulting value.
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 kudu::client::KuduScanBatch::RowPtr::GetInt16 ( const Slice & col_name,
int16_t * val ) const
Parameters
[in]col_nameThe name of the target column.
[out]valPlaceholder for the result value.
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 kudu::client::KuduScanBatch::RowPtr::GetInt16 ( int col_idx,
int16_t * val ) const
Parameters
[in]col_idxThe index of the column.
[out]valPointer to the placeholder to put the resulting value.
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 kudu::client::KuduScanBatch::RowPtr::GetInt32 ( const Slice & col_name,
int32_t * val ) const
Parameters
[in]col_nameThe name of the target column.
[out]valPlaceholder for the result value.
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 kudu::client::KuduScanBatch::RowPtr::GetInt32 ( int col_idx,
int32_t * val ) const
Parameters
[in]col_idxThe index of the column.
[out]valPointer to the placeholder to put the resulting value.
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 kudu::client::KuduScanBatch::RowPtr::GetInt64 ( const Slice & col_name,
int64_t * val ) const
Parameters
[in]col_nameThe name of the target column.
[out]valPlaceholder for the result value.
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 kudu::client::KuduScanBatch::RowPtr::GetInt64 ( int col_idx,
int64_t * val ) const
Parameters
[in]col_idxThe index of the column.
[out]valPointer to the placeholder to put the resulting value.
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 kudu::client::KuduScanBatch::RowPtr::GetInt8 ( const Slice & col_name,
int8_t * val ) const
Parameters
[in]col_nameThe name of the target column.
[out]valPlaceholder for the result value.
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 kudu::client::KuduScanBatch::RowPtr::GetInt8 ( int col_idx,
int8_t * val ) const
Parameters
[in]col_idxThe index of the column.
[out]valPointer to the placeholder to put the resulting value.
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 kudu::client::KuduScanBatch::RowPtr::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 kudu::client::KuduScanBatch::RowPtr::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 using indices avoids a hashmap lookup, 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 kudu::client::KuduScanBatch::RowPtr::GetUnixTimeMicros ( const Slice & col_name,
int64_t * micros_since_utc_epoch ) const
Parameters
[in]col_nameThe name of the target column.
[out]micros_since_utc_epochPlaceholder for the result value.
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 kudu::client::KuduScanBatch::RowPtr::GetUnixTimeMicros ( int col_idx,
int64_t * micros_since_utc_epoch ) const
Parameters
[in]col_idxThe index of the column.
[out]micros_since_utc_epochPointer to the placeholder to put the resulting value.
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 kudu::client::KuduScanBatch::RowPtr::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 kudu::client::KuduScanBatch::RowPtr::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 using indices avoids a hashmap lookup, 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.

◆ IsDeleted()

Status kudu::client::KuduScanBatch::RowPtr::IsDeleted ( bool * val) const

Get the value of the IS_DELETED virtual column.

Parameters
[out]valPlaceholder for the result value.
Returns
Operation result status. Return a bad Status if there is no IS_DELETED virtual column in the schema.

◆ IsNull() [1/2]

bool kudu::client::KuduScanBatch::RowPtr::IsNull ( const Slice & col_name) const
Parameters
[in]col_nameName of the column.
Returns
true iff the specified column of the row has NULL value.

◆ IsNull() [2/2]

bool kudu::client::KuduScanBatch::RowPtr::IsNull ( int col_idx) const
Parameters
[in]col_idxIndex of the column.
Returns
true iff the specified column of the row has NULL value.

◆ operator->()

const RowPtr * kudu::client::KuduScanBatch::RowPtr::operator-> ( ) const
inline

Overloaded operator -> to support pointer trait for access via const_iterator.

Returns
Pointer to the row

◆ ToString()

std::string kudu::client::KuduScanBatch::RowPtr::ToString ( ) const
Returns
String representation for this row.

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