Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
operators.cc File Reference
Include dependency graph for operators.cc:

Go to the source code of this file.

Namespaces

 impala
 This file contains type definitions that are used throughout the code base.
 

Macros

#define BINARY_OP_FN(NAME, TYPE, OP)
 
#define BINARY_OP_CHECK_ZERO_FN(NAME, TYPE, OP)
 
#define BITNOT_FN(TYPE)
 
#define BINARY_PREDICATE_NUMERIC_FN(NAME, TYPE, OP)
 
#define BINARY_PREDICATE_NONNUMERIC_FN(NAME, TYPE, IMPALA_TYPE, OP)
 
#define BINARY_PREDICATE_CHAR(NAME, OP)
 
#define BINARY_OP_NUMERIC_TYPES(NAME, OP)
 
#define BINARY_OP_INT_TYPES(NAME, OP)
 
#define BINARY_OP_CHECK_ZERO_INT_TYPES(NAME, OP)
 
#define BINARY_PREDICATE_ALL_TYPES(NAME, OP)
 

Functions

 impala::BINARY_OP_NUMERIC_TYPES (Add,+)
 
 impala::BINARY_OP_NUMERIC_TYPES (Subtract,-)
 
 impala::BINARY_OP_NUMERIC_TYPES (Multiply,*)
 
 impala::BINARY_OP_FN (Divide, DoubleVal,/)
 
 impala::BINARY_OP_CHECK_ZERO_INT_TYPES (Int_divide,/)
 
 impala::BINARY_OP_CHECK_ZERO_INT_TYPES (Mod,%)
 
 impala::BINARY_OP_INT_TYPES (Bitand,&)
 
 impala::BINARY_OP_INT_TYPES (Bitxor,^)
 
 impala::BINARY_OP_INT_TYPES (Bitor,|)
 
 impala::BITNOT_FN (TinyIntVal)
 
 impala::BITNOT_FN (SmallIntVal)
 
 impala::BITNOT_FN (IntVal)
 
 impala::BITNOT_FN (BigIntVal)
 
 impala::BINARY_PREDICATE_ALL_TYPES (Eq,==)
 
 impala::BINARY_PREDICATE_ALL_TYPES (Ne,!=)
 
 impala::BINARY_PREDICATE_ALL_TYPES (Gt, >)
 
 impala::BINARY_PREDICATE_ALL_TYPES (Lt,<)
 
 impala::BINARY_PREDICATE_ALL_TYPES (Ge, >=)
 
 impala::BINARY_PREDICATE_ALL_TYPES (Le,<=)
 

Macro Definition Documentation

#define BINARY_OP_CHECK_ZERO_FN (   NAME,
  TYPE,
  OP 
)
Value:
TYPE Operators::NAME##_##TYPE##_##TYPE(\
FunctionContext* c, const TYPE& v1, const TYPE& v2) {\
if (v1.is_null || v2.is_null || v2.val == 0) return TYPE::null();\
return TYPE(v1.val OP v2.val);\
}

Definition at line 27 of file operators.cc.

#define BINARY_OP_CHECK_ZERO_INT_TYPES (   NAME,
  OP 
)
Value:

Definition at line 83 of file operators.cc.

#define BINARY_OP_FN (   NAME,
  TYPE,
  OP 
)
Value:
TYPE Operators::NAME##_##TYPE##_##TYPE(\
FunctionContext* c, const TYPE& v1, const TYPE& v2) {\
if (v1.is_null || v2.is_null) return TYPE::null();\
return TYPE(v1.val OP v2.val);\
}

Definition at line 20 of file operators.cc.

#define BINARY_OP_INT_TYPES (   NAME,
  OP 
)
Value:

Definition at line 77 of file operators.cc.

#define BINARY_OP_NUMERIC_TYPES (   NAME,
  OP 
)
Value:

Definition at line 69 of file operators.cc.

#define BINARY_PREDICATE_ALL_TYPES (   NAME,
  OP 
)
Value:
This object has a compatible storage format with boost::ptime.
Definition: udf.h:495
#define BINARY_PREDICATE_NUMERIC_FN(NAME, TYPE, OP)
Definition: operators.cc:40
#define BINARY_PREDICATE_NONNUMERIC_FN(NAME, TYPE, IMPALA_TYPE, OP)
Definition: operators.cc:47
#define BINARY_PREDICATE_CHAR(NAME, OP)
Definition: operators.cc:56

Definition at line 89 of file operators.cc.

#define BINARY_PREDICATE_CHAR (   NAME,
  OP 
)
Value:
BooleanVal Operators::NAME##_Char_Char(\
FunctionContext* c, const StringVal& v1, const StringVal& v2) {\
if (v1.is_null || v2.is_null) return BooleanVal::null();\
const ColumnType& v1_type = AnyValUtil::TypeDescToColumnType(*c->GetArgType(0));\
const ColumnType& v2_type = AnyValUtil::TypeDescToColumnType(*c->GetArgType(1));\
StringValue iv1 = StringValue::FromStringVal(v1);\
StringValue iv2 = StringValue::FromStringVal(v2);\
iv1.len = StringValue::UnpaddedCharLength(iv1.ptr, v1_type.len);\
iv2.len = StringValue::UnpaddedCharLength(iv2.ptr, v2_type.len);\
return BooleanVal(iv1 OP iv2);\
}
bool is_null
Definition: udf.h:359

Definition at line 56 of file operators.cc.

#define BINARY_PREDICATE_NONNUMERIC_FN (   NAME,
  TYPE,
  IMPALA_TYPE,
  OP 
)
Value:
BooleanVal Operators::NAME##_##TYPE##_##TYPE(\
FunctionContext* c, const TYPE& v1, const TYPE& v2) {\
if (v1.is_null || v2.is_null) return BooleanVal::null();\
IMPALA_TYPE iv1 = IMPALA_TYPE::From##TYPE(v1);\
IMPALA_TYPE iv2 = IMPALA_TYPE::From##TYPE(v2);\
return BooleanVal(iv1 OP iv2);\
}

Definition at line 47 of file operators.cc.

#define BINARY_PREDICATE_NUMERIC_FN (   NAME,
  TYPE,
  OP 
)
Value:
BooleanVal Operators::NAME##_##TYPE##_##TYPE(\
FunctionContext* c, const TYPE& v1, const TYPE& v2) {\
if (v1.is_null || v2.is_null) return BooleanVal::null();\
return BooleanVal(v1.val OP v2.val);\
}

Definition at line 40 of file operators.cc.

#define BITNOT_FN (   TYPE)
Value:
TYPE Operators::Bitnot_##TYPE(FunctionContext* c, const TYPE& v) {\
if (v.is_null) return TYPE::null();\
return TYPE(~v.val);\
}

Definition at line 34 of file operators.cc.