Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
impala::ExprTest Class Reference
Inheritance diagram for impala::ExprTest:
Collaboration diagram for impala::ExprTest:

Public Member Functions

template<>
void TestCast (const string &stmt, const char *val, bool timestamp_out_of_range)
 

Protected Types

typedef map< int, int64_t > IntValMap
 
typedef unordered_map< int,
double > 
FloatValMap
 

Protected Member Functions

virtual void SetUp ()
 
void GetValue (const string &expr, const ColumnType &expr_type, void **interpreted_value, bool expect_error=false)
 
void * ConvertValue (const ColumnType &type, const string &value)
 
void TestStringValue (const string &expr, const string &expected_result)
 
void TestCharValue (const string &expr, const string &expected_result, const ColumnType &type)
 
void TestTimestampValue (const string &expr, const TimestampValue &expected_result, const int64_t tolerance_in_seconds=0)
 
void TestValidTimestampValue (const string &expr)
 
void TestTimestampUnixEpochConversions (int64_t unix_time_at_local_epoch, string local_time_at_unix_epoch)
 
template<typename T >
void TestDecimalValue (const string &expr, const T &expected_result, const ColumnType &expected_type)
 
template<class T >
void TestValue (const string &expr, const ColumnType &expr_type, const T &expected_result)
 
void TestIsNull (const string &expr, const ColumnType &expr_type)
 
void TestError (const string &expr)
 
void TestNonOkStatus (const string &expr)
 
template<typename T >
void TestFixedPointComparisons (bool test_boundaries)
 
template<typename T >
void TestFloatingPointComparisons (bool test_boundaries)
 
void TestStringComparisons ()
 
void TestDecimalComparisons ()
 
void TestNullComparison (const string &op)
 
void TestNullComparisons ()
 
void TestComparison (const string &smaller, const string &larger, bool compare_strings)
 
void TestBinaryPredicates (const string &value, bool compare_strings)
 
template<typename T >
void TestFixedPointLimits (const ColumnType &type)
 
template<typename T >
void TestFloatingPointLimits (const ColumnType &type)
 
template<typename LeftOp , typename RightOp , typename Result >
void TestFixedResultTypeOps (LeftOp a, RightOp b, const ColumnType &expected_type)
 
template<typename LeftOp , typename RightOp >
void TestVariableResultTypeIntOps (LeftOp a, RightOp b, const ColumnType &expected_type)
 
template<typename NonNullOp , typename CastType >
void TestNullOperandFixedResultTypeOps (NonNullOp op, const ColumnType &expected_type)
 
template<typename NonNullOp >
void TestNullOperandVariableResultTypeIntOps (NonNullOp op, const ColumnType &expected_type)
 
void TestNullOperandsArithmeticOps ()
 
template<typename T >
void TestCast (const string &stmt, T val, bool timestamp_out_of_range=false)
 

Protected Attributes

IntValMap min_int_values_
 
FloatValMap min_float_values_
 
unordered_map< int, string > default_type_strs_
 
string default_bool_str_
 
string default_string_str_
 
string default_timestamp_str_
 
string default_decimal_str_
 
bool default_bool_val_
 
string default_string_val_
 
TimestampValue default_timestamp_val_
 
ExprValue expr_value_
 

Detailed Description

Definition at line 142 of file expr-test.cc.

Member Typedef Documentation

typedef unordered_map<int, double> impala::ExprTest::FloatValMap
protected

Definition at line 153 of file expr-test.cc.

typedef map<int, int64_t> impala::ExprTest::IntValMap
protected

Definition at line 148 of file expr-test.cc.

Member Function Documentation

void impala::ExprTest::GetValue ( const string &  expr,
const ColumnType expr_type,
void **  interpreted_value,
bool  expect_error = false 
)
inlineprotected
void impala::ExprTest::TestBinaryPredicates ( const string &  value,
bool  compare_strings 
)
inlineprotected

Definition at line 613 of file expr-test.cc.

References impala::TYPE_BOOLEAN.

template<typename T >
void impala::ExprTest::TestCast ( const string &  stmt,
val,
bool  timestamp_out_of_range = false 
)
inlineprotected
template<>
void impala::ExprTest::TestCast ( const string &  stmt,
const char *  val,
bool  timestamp_out_of_range 
)
void impala::ExprTest::TestCharValue ( const string &  expr,
const string &  expected_result,
const ColumnType type 
)
inlineprotected

Definition at line 297 of file expr-test.cc.

References impala::StringValue::len, and impala::StringValue::ptr.

void impala::ExprTest::TestComparison ( const string &  smaller,
const string &  larger,
bool  compare_strings 
)
inlineprotected

Definition at line 562 of file expr-test.cc.

References impala::TYPE_BOOLEAN.

void impala::ExprTest::TestDecimalComparisons ( )
inlineprotected

Definition at line 511 of file expr-test.cc.

References impala::TYPE_BOOLEAN.

template<typename T >
void impala::ExprTest::TestDecimalValue ( const string &  expr,
const T &  expected_result,
const ColumnType expected_type 
)
inlineprotected

Definition at line 363 of file expr-test.cc.

void impala::ExprTest::TestError ( const string &  expr)
inlineprotected

Definition at line 423 of file expr-test.cc.

References impala::INVALID_TYPE.

template<typename T >
void impala::ExprTest::TestFixedPointComparisons ( bool  test_boundaries)
inlineprotected

Definition at line 435 of file expr-test.cc.

template<typename T >
void impala::ExprTest::TestFixedPointLimits ( const ColumnType type)
inlineprotected

Definition at line 662 of file expr-test.cc.

template<typename LeftOp , typename RightOp , typename Result >
void impala::ExprTest::TestFixedResultTypeOps ( LeftOp  a,
RightOp  b,
const ColumnType expected_type 
)
inlineprotected

Definition at line 689 of file expr-test.cc.

References impala::TYPE_DOUBLE.

template<typename T >
void impala::ExprTest::TestFloatingPointComparisons ( bool  test_boundaries)
inlineprotected

Definition at line 451 of file expr-test.cc.

References impala::TYPE_BOOLEAN.

template<typename T >
void impala::ExprTest::TestFloatingPointLimits ( const ColumnType type)
inlineprotected

Definition at line 671 of file expr-test.cc.

void impala::ExprTest::TestIsNull ( const string &  expr,
const ColumnType expr_type 
)
inlineprotected

Definition at line 417 of file expr-test.cc.

void impala::ExprTest::TestNonOkStatus ( const string &  expr)
inlineprotected
void impala::ExprTest::TestNullComparison ( const string &  op)
inlineprotected

Definition at line 531 of file expr-test.cc.

References impala::TYPE_BOOLEAN.

void impala::ExprTest::TestNullComparisons ( )
inlineprotected

Definition at line 551 of file expr-test.cc.

template<typename NonNullOp , typename CastType >
void impala::ExprTest::TestNullOperandFixedResultTypeOps ( NonNullOp  op,
const ColumnType expected_type 
)
inlineprotected

Definition at line 727 of file expr-test.cc.

References impala::TYPE_DOUBLE.

void impala::ExprTest::TestNullOperandsArithmeticOps ( )
inlineprotected

Definition at line 764 of file expr-test.cc.

References impala::TYPE_DOUBLE, and impala::TYPE_INT.

template<typename NonNullOp >
void impala::ExprTest::TestNullOperandVariableResultTypeIntOps ( NonNullOp  op,
const ColumnType expected_type 
)
inlineprotected

Definition at line 745 of file expr-test.cc.

void impala::ExprTest::TestStringComparisons ( )
inlineprotected

Definition at line 487 of file expr-test.cc.

References impala::TYPE_BOOLEAN.

void impala::ExprTest::TestStringValue ( const string &  expr,
const string &  expected_result 
)
inlineprotected
void impala::ExprTest::TestTimestampUnixEpochConversions ( int64_t  unix_time_at_local_epoch,
string  local_time_at_unix_epoch 
)
inlineprotected

Definition at line 332 of file expr-test.cc.

References impala::TYPE_BIGINT, and impala::TYPE_STRING.

void impala::ExprTest::TestTimestampValue ( const string &  expr,
const TimestampValue expected_result,
const int64_t  tolerance_in_seconds = 0 
)
inlineprotected
void impala::ExprTest::TestValidTimestampValue ( const string &  expr)
inlineprotected
template<class T >
void impala::ExprTest::TestValue ( const string &  expr,
const ColumnType expr_type,
const T &  expected_result 
)
inlineprotected
template<typename LeftOp , typename RightOp >
void impala::ExprTest::TestVariableResultTypeIntOps ( LeftOp  a,
RightOp  b,
const ColumnType expected_type 
)
inlineprotected

Definition at line 708 of file expr-test.cc.

Member Data Documentation

string impala::ExprTest::default_bool_str_
protected

Definition at line 161 of file expr-test.cc.

bool impala::ExprTest::default_bool_val_
protected

Definition at line 166 of file expr-test.cc.

string impala::ExprTest::default_decimal_str_
protected

Definition at line 164 of file expr-test.cc.

string impala::ExprTest::default_string_str_
protected

Definition at line 162 of file expr-test.cc.

string impala::ExprTest::default_string_val_
protected

Definition at line 167 of file expr-test.cc.

string impala::ExprTest::default_timestamp_str_
protected

Definition at line 163 of file expr-test.cc.

TimestampValue impala::ExprTest::default_timestamp_val_
protected

Definition at line 168 of file expr-test.cc.

unordered_map<int, string> impala::ExprTest::default_type_strs_
protected

Definition at line 160 of file expr-test.cc.

ExprValue impala::ExprTest::expr_value_
protected

Definition at line 171 of file expr-test.cc.

FloatValMap impala::ExprTest::min_float_values_
protected

Definition at line 154 of file expr-test.cc.

IntValMap impala::ExprTest::min_int_values_
protected

Definition at line 149 of file expr-test.cc.


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