Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
impala::TupleRowComparator Class Reference

#include <tuple-row-compare.h>

Collaboration diagram for impala::TupleRowComparator:

Public Member Functions

 TupleRowComparator (const std::vector< ExprContext * > &key_expr_ctxs_lhs, const std::vector< ExprContext * > &key_expr_ctxs_rhs, const std::vector< bool > &is_asc, const std::vector< bool > &nulls_first)
 
 TupleRowComparator (const std::vector< ExprContext * > &key_expr_ctxs_lhs, const std::vector< ExprContext * > &key_expr_ctxs_rhs, bool is_asc, bool nulls_first)
 
int Compare (TupleRow *lhs, TupleRow *rhs) const
 
bool operator() (TupleRow *lhs, TupleRow *rhs) const
 
bool operator() (Tuple *lhs, Tuple *rhs) const
 

Private Attributes

std::vector< ExprContext * > key_expr_ctxs_lhs_
 
std::vector< ExprContext * > key_expr_ctxs_rhs_
 
std::vector< boolis_asc_
 
std::vector< int8_t > nulls_first_
 

Detailed Description

Definition at line 27 of file tuple-row-compare.h.

Constructor & Destructor Documentation

impala::TupleRowComparator::TupleRowComparator ( const std::vector< ExprContext * > &  key_expr_ctxs_lhs,
const std::vector< ExprContext * > &  key_expr_ctxs_rhs,
const std::vector< bool > &  is_asc,
const std::vector< bool > &  nulls_first 
)
inline

Compares two TupleRows based on a set of exprs, in order. We use is_asc to determine, for each expr, if it should be ascending or descending sort order. We use nulls_first to determine, for each expr, if nulls should come before or after all other values.

Definition at line 34 of file tuple-row-compare.h.

References nulls_first_.

impala::TupleRowComparator::TupleRowComparator ( const std::vector< ExprContext * > &  key_expr_ctxs_lhs,
const std::vector< ExprContext * > &  key_expr_ctxs_rhs,
bool  is_asc,
bool  nulls_first 
)
inline

Definition at line 51 of file tuple-row-compare.h.

Member Function Documentation

int impala::TupleRowComparator::Compare ( TupleRow lhs,
TupleRow rhs 
) const
inline

Returns a negative value if lhs is less than rhs, a positive value if lhs is greater than rhs, or 0 if they are equal. All exprs (key_exprs_lhs_ and key_exprs_rhs_) must have been prepared and opened before calling this.

Definition at line 65 of file tuple-row-compare.h.

References impala::RawValue::Compare(), is_asc_, key_expr_ctxs_lhs_, key_expr_ctxs_rhs_, and nulls_first_.

Referenced by operator()().

bool impala::TupleRowComparator::operator() ( TupleRow lhs,
TupleRow rhs 
) const
inline

Returns true if lhs is strictly less than rhs. All exprs (key_exprs_lhs_ and key_exprs_rhs_) must have been prepared and opened before calling this.

Definition at line 87 of file tuple-row-compare.h.

References Compare().

bool impala::TupleRowComparator::operator() ( Tuple lhs,
Tuple rhs 
) const
inline

Definition at line 93 of file tuple-row-compare.h.

Member Data Documentation

std::vector<bool> impala::TupleRowComparator::is_asc_
private

Definition at line 102 of file tuple-row-compare.h.

Referenced by Compare().

std::vector<ExprContext*> impala::TupleRowComparator::key_expr_ctxs_lhs_
private

Definition at line 100 of file tuple-row-compare.h.

Referenced by Compare().

std::vector<ExprContext*> impala::TupleRowComparator::key_expr_ctxs_rhs_
private

Definition at line 101 of file tuple-row-compare.h.

Referenced by Compare().

std::vector<int8_t> impala::TupleRowComparator::nulls_first_
private

Definition at line 103 of file tuple-row-compare.h.

Referenced by Compare(), and TupleRowComparator().


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