Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
#include <codegen-anyval.h>
Public Member Functions | |
CodegenAnyVal (LlvmCodeGen *codegen, LlvmCodeGen::LlvmBuilder *builder, const ColumnType &type, llvm::Value *value=NULL, const char *name="") | |
Creates a wrapper around a lowered *Val value. More... | |
llvm::Value * | value () |
Returns the current type-lowered value. More... | |
llvm::Value * | GetIsNull (const char *name="is_null") |
Gets the 'is_null' field of the *Val. More... | |
llvm::Value * | GetVal (const char *name="val") |
void | SetIsNull (llvm::Value *is_null) |
Sets the 'is_null' field of the *Val. More... | |
void | SetVal (llvm::Value *val) |
void | SetVal (bool val) |
Sets the 'val' field of the *Val. The *Val must correspond to the argument type. More... | |
void | SetVal (int8_t val) |
void | SetVal (int16_t val) |
void | SetVal (int32_t val) |
void | SetVal (int64_t val) |
void | SetVal (int128_t val) |
void | SetVal (float val) |
void | SetVal (double val) |
llvm::Value * | GetPtr () |
Getters for StringVals. More... | |
llvm::Value * | GetLen () |
void | SetPtr (llvm::Value *ptr) |
Setters for StringVals. More... | |
void | SetLen (llvm::Value *len) |
llvm::Value * | GetDate () |
Getters for TimestampVals. More... | |
llvm::Value * | GetTimeOfDay () |
void | SetDate (llvm::Value *date) |
Setters for TimestampVals. More... | |
void | SetTimeOfDay (llvm::Value *time_of_day) |
llvm::Value * | GetUnloweredPtr () |
void | SetFromRawValue (llvm::Value *raw_val) |
void | SetFromRawPtr (llvm::Value *raw_ptr) |
llvm::Value * | ToNativeValue () |
void | ToNativePtr (llvm::Value *native_ptr) |
llvm::Value * | Eq (CodegenAnyVal *other) |
Returns the i1 result of this == other. this and other must be non-null. More... | |
llvm::Value * | EqToNativePtr (llvm::Value *native_ptr) |
CodegenAnyVal () | |
Ctor for created an uninitialized CodegenAnYVal that can be assigned to later. More... | |
Static Public Member Functions | |
static llvm::Value * | CreateCall (LlvmCodeGen *cg, LlvmCodeGen::LlvmBuilder *builder, llvm::Function *fn, llvm::ArrayRef< llvm::Value * > args, const char *name="", llvm::Value *result_ptr=NULL) |
'name' optionally specifies the name of the returned value. More... | |
static CodegenAnyVal | CreateCallWrapped (LlvmCodeGen *cg, LlvmCodeGen::LlvmBuilder *builder, const ColumnType &type, llvm::Function *fn, llvm::ArrayRef< llvm::Value * > args, const char *name="", llvm::Value *result_ptr=NULL) |
Same as above but wraps the result in a CodegenAnyVal. More... | |
static llvm::Type * | GetLoweredType (LlvmCodeGen *cg, const ColumnType &type) |
static llvm::Type * | GetLoweredPtrType (LlvmCodeGen *cg, const ColumnType &type) |
static llvm::Type * | GetUnloweredType (LlvmCodeGen *cg, const ColumnType &type) |
static llvm::Type * | GetUnloweredPtrType (LlvmCodeGen *cg, const ColumnType &type) |
static llvm::Value * | GetNullVal (LlvmCodeGen *codegen, const ColumnType &type) |
static llvm::Value * | GetNullVal (LlvmCodeGen *codegen, llvm::Type *val_type) |
static CodegenAnyVal | GetNonNullVal (LlvmCodeGen *codegen, LlvmCodeGen::LlvmBuilder *builder, const ColumnType &type, const char *name="") |
Static Public Attributes | |
static const char * | LLVM_BOOLEANVAL_NAME = "struct.impala_udf::BooleanVal" |
static const char * | LLVM_TINYINTVAL_NAME = "struct.impala_udf::TinyIntVal" |
static const char * | LLVM_SMALLINTVAL_NAME = "struct.impala_udf::SmallIntVal" |
static const char * | LLVM_INTVAL_NAME = "struct.impala_udf::IntVal" |
static const char * | LLVM_BIGINTVAL_NAME = "struct.impala_udf::BigIntVal" |
static const char * | LLVM_FLOATVAL_NAME = "struct.impala_udf::FloatVal" |
static const char * | LLVM_DOUBLEVAL_NAME = "struct.impala_udf::DoubleVal" |
static const char * | LLVM_STRINGVAL_NAME = "struct.impala_udf::StringVal" |
static const char * | LLVM_TIMESTAMPVAL_NAME = "struct.impala_udf::TimestampVal" |
static const char * | LLVM_DECIMALVAL_NAME = "struct.impala_udf::DecimalVal" |
Private Member Functions | |
llvm::Value * | GetHighBits (int num_bits, llvm::Value *v, const char *name="") |
llvm::Value * | SetHighBits (int num_bits, llvm::Value *src, llvm::Value *dst, const char *name="") |
Private Attributes | |
ColumnType | type_ |
llvm::Value * | value_ |
const char * | name_ |
LlvmCodeGen * | codegen_ |
LlvmCodeGen::LlvmBuilder * | builder_ |
Class for handling AnyVal subclasses during codegen. Codegen functions should use this wrapper instead of creating or manipulating Val values directly in most cases. This is because the struct types must be lowered to integer types in many cases in order to conform to the standard calling convention (e.g., { i8, i32 } => i64). This class wraps the lowered types for each Val struct. This class conceptually represents a single Val that is mutated, but operates by generating IR instructions involving value_ (each of which generates a new Value, since IR uses SSA), and then setting value_ to the most recent Value generated. The generated instructions perform the integer manipulation equivalent to setting the fields of the original struct type. Lowered types: TYPE_BOOLEAN/BooleanVal: i16 TYPE_TINYINT/TinyIntVal: i16 TYPE_SMALLINT/SmallIntVal: i32 TYPE_INT/INTVal: i64 TYPE_BIGINT/BigIntVal: { i8, i64 } TYPE_FLOAT/FloatVal: i64 TYPE_DOUBLE/DoubleVal: { i8, double } TYPE_STRING/StringVal: { i64, i8 } TYPE_TIMESTAMP/TimestampVal: { i64, i64 } TODO:
Definition at line 52 of file codegen-anyval.h.
impala::CodegenAnyVal::CodegenAnyVal | ( | LlvmCodeGen * | codegen, |
LlvmCodeGen::LlvmBuilder * | builder, | ||
const ColumnType & | type, | ||
llvm::Value * | value = NULL , |
||
const char * | name = "" |
||
) |
Creates a wrapper around a lowered *Val value.
Instructions for manipulating the value are generated using 'builder'. The insert point of 'builder' is not modified by this class, and it is safe to call 'builder'.SetInsertPoint() after passing 'builder' to this class. 'type' identified the type of wrapped value (e.g., TYPE_INT corresponds to IntVal, which is lowered to i64). If 'value' is NULL, a new value of the lowered type is alloca'd. Otherwise 'value' must be of the correct lowered type. If 'name' is specified, it will be used when generated instructions that set value_.
|
inline |
Ctor for created an uninitialized CodegenAnYVal that can be assigned to later.
Definition at line 211 of file codegen-anyval.h.
Referenced by GetNonNullVal().
|
static |
'name' optionally specifies the name of the returned value.
Creates a call to 'fn', which should return a (lowered) Val, and returns the result. This abstracts over the x64 calling convention, in particular for functions returning a DecimalVal, which pass the return value as an output argument. If 'result_ptr' is non-NULL, it should be a pointer to the lowered return type of 'fn' (e.g. if 'fn' returns a BooleanVal, 'result_ptr' should have type i16). The result of calling 'fn' will be stored in 'result_ptr' and this function will return NULL. If 'result_ptr' is NULL, this function will return the result (note that the result will not be a pointer in this case).
Definition at line 116 of file codegen-anyval.cc.
References impala::LlvmCodeGen::CreateEntryBlockAlloca(), and impala::LlvmCodeGen::GetType().
Referenced by impala::CaseExpr::GetCodegendComputeFn(), impala::ScalarFnCall::GetCodegendComputeFn(), and impala::Expr::GetCodegendComputeFnWrapper().
|
static |
Same as above but wraps the result in a CodegenAnyVal.
Definition at line 148 of file codegen-anyval.cc.
Referenced by impala::CompoundPredicate::CodegenComputeFn(), impala::HashTableCtx::CodegenEquals(), impala::OldHashTable::CodegenEquals(), impala::ExecNode::CodegenEvalConjuncts(), impala::HashTableCtx::CodegenEvalRow(), impala::OldHashTable::CodegenEvalTupleRow(), impala::AggregationNode::CodegenUpdateSlot(), impala::PartitionedAggregationNode::CodegenUpdateSlot(), impala::HdfsScanner::CodegenWriteCompleteTuple(), and impala::CaseExpr::GetCodegendComputeFn().
Value * CodegenAnyVal::Eq | ( | CodegenAnyVal * | other | ) |
Returns the i1 result of this == other. this and other must be non-null.
Definition at line 551 of file codegen-anyval.cc.
References builder_, codegen_, impala::ColumnType::DebugString(), impala::LlvmCodeGen::GetFunction(), GetUnloweredPtr(), GetVal(), impala::ColumnType::type, type_, impala::TYPE_BIGINT, impala::TYPE_BOOLEAN, impala::TYPE_DECIMAL, impala::TYPE_DOUBLE, impala::TYPE_FLOAT, impala::TYPE_INT, impala::TYPE_SMALLINT, impala::TYPE_STRING, impala::TYPE_TIMESTAMP, impala::TYPE_TINYINT, and impala::TYPE_VARCHAR.
Referenced by impala::CaseExpr::GetCodegendComputeFn().
Value * CodegenAnyVal::EqToNativePtr | ( | llvm::Value * | native_ptr | ) |
Compares this Val to the value of 'native_ptr'. 'native_ptr' should be a pointer to a native type, StringValue, or TimestampValue. This *Val should match 'native_ptr's type (e.g. if this is an IntVal, 'native_ptr' should have type i32). Returns the i1 result of the equality comparison.
Definition at line 582 of file codegen-anyval.cc.
References builder_, codegen_, impala::ColumnType::DebugString(), impala::LlvmCodeGen::false_value(), impala::LlvmCodeGen::GetFunction(), GetUnloweredPtr(), GetVal(), impala::ColumnType::IsStringType(), impala::ColumnType::type, type_, impala::TYPE_BIGINT, impala::TYPE_BOOLEAN, impala::TYPE_DECIMAL, impala::TYPE_DOUBLE, impala::TYPE_FLOAT, impala::TYPE_INT, impala::TYPE_NULL, impala::TYPE_SMALLINT, impala::TYPE_STRING, impala::TYPE_TIMESTAMP, impala::TYPE_TINYINT, and impala::TYPE_VARCHAR.
Referenced by impala::HashTableCtx::CodegenEquals(), and impala::OldHashTable::CodegenEquals().
Value * CodegenAnyVal::GetDate | ( | ) |
Getters for TimestampVals.
Definition at line 424 of file codegen-anyval.cc.
References builder_, GetHighBits(), impala::ColumnType::type, type_, impala::TYPE_TIMESTAMP, and value_.
Referenced by ToNativeValue().
|
private |
Helper function for getting the top (most significant) half of 'v'. 'v' should have width = 'num_bits' * 2 and be an integer type.
Definition at line 616 of file codegen-anyval.cc.
References builder_, codegen_, and impala::LlvmCodeGen::context().
Value * CodegenAnyVal::GetIsNull | ( | const char * | name = "is_null" | ) |
Gets the 'is_null' field of the *Val.
Definition at line 171 of file codegen-anyval.cc.
References impala::LlvmCodeGen::bigint_type(), impala::LlvmCodeGen::boolean_type(), builder_, codegen_, impala::name, impala::LlvmCodeGen::tinyint_type(), impala::ColumnType::type, type_, impala::TYPE_BIGINT, impala::TYPE_BOOLEAN, impala::TYPE_CHAR, impala::TYPE_DECIMAL, impala::TYPE_DOUBLE, impala::TYPE_FLOAT, impala::TYPE_INT, impala::TYPE_SMALLINT, impala::TYPE_STRING, impala::TYPE_TIMESTAMP, impala::TYPE_TINYINT, impala::TYPE_VARCHAR, and value_.
Referenced by impala::CompoundPredicate::CodegenComputeFn(), impala::HashTableCtx::CodegenEquals(), impala::OldHashTable::CodegenEquals(), impala::ExecNode::CodegenEvalConjuncts(), impala::HashTableCtx::CodegenEvalRow(), impala::OldHashTable::CodegenEvalTupleRow(), impala::AggregationNode::CodegenUpdateSlot(), impala::PartitionedAggregationNode::CodegenUpdateSlot(), and impala::CaseExpr::GetCodegendComputeFn().
Value * CodegenAnyVal::GetLen | ( | ) |
Definition at line 397 of file codegen-anyval.cc.
References builder_, GetHighBits(), impala::ColumnType::IsStringType(), type_, and value_.
Referenced by ToNativeValue().
|
static |
Returns the lowered AnyVal pointer type associated with 'type'. E.g.: TYPE_BOOLEAN => i16*
Definition at line 65 of file codegen-anyval.cc.
Referenced by impala::ScalarFnCall::GetCodegendComputeFn().
|
static |
Returns the lowered AnyVal type associated with 'type'. E.g.: TYPE_BOOLEAN (which corresponds to a BooleanVal) => i16
Definition at line 34 of file codegen-anyval.cc.
References impala::LlvmCodeGen::bigint_type(), impala::LlvmCodeGen::double_type(), impala::LlvmCodeGen::GetType(), impala::LlvmCodeGen::int_type(), impala::LlvmCodeGen::ptr_type(), impala::LlvmCodeGen::smallint_type(), impala::LlvmCodeGen::tinyint_type(), impala::ColumnType::type, impala::TYPE_BIGINT, impala::TYPE_BOOLEAN, impala::TYPE_CHAR, impala::TYPE_DECIMAL, impala::TYPE_DOUBLE, impala::TYPE_FLOAT, impala::TYPE_INT, impala::TYPE_SMALLINT, impala::TYPE_STRING, impala::TYPE_TIMESTAMP, impala::TYPE_TINYINT, and impala::TYPE_VARCHAR.
Referenced by impala::Expr::CreateIrFunctionPrototype(), GetNonNullVal(), GetNullVal(), and impala::ScalarFnCall::GetUdf().
|
static |
Return the constant type-lowered value corresponding to a non-null Val. E.g.: TYPE_DOUBLE (lowered DoubleVal: { i8, double }) => { 0, 0 } This returns a CodegenAnyVal, rather than the unwrapped Value, because the actual value still needs to be set.
Definition at line 674 of file codegen-anyval.cc.
References CodegenAnyVal(), and GetLoweredType().
Referenced by impala::AggregationNode::CodegenUpdateSlot(), impala::PartitionedAggregationNode::CodegenUpdateSlot(), impala::SlotRef::GetCodegendComputeFn(), and impala::Literal::GetCodegendComputeFn().
|
static |
Return the constant type-lowered value corresponding to a null *Val. E.g.: passing TYPE_DOUBLE (corresponding to the lowered DoubleVal { i8, double }) returns the constant struct { 1, 0.0 }
Definition at line 639 of file codegen-anyval.cc.
References GetLoweredType().
Referenced by impala::CaseExpr::GetCodegendComputeFn().
|
static |
Return the constant type-lowered value corresponding to a null *Val. 'val_type' must be a lowered type (i.e. one of the types returned by GetType)
Value * CodegenAnyVal::GetPtr | ( | ) |
Getters for StringVals.
Definition at line 391 of file codegen-anyval.cc.
References builder_, impala::ColumnType::IsStringType(), name_, type_, and value_.
Referenced by ToNativeValue().
Value * CodegenAnyVal::GetTimeOfDay | ( | ) |
Definition at line 418 of file codegen-anyval.cc.
References builder_, impala::ColumnType::type, type_, impala::TYPE_TIMESTAMP, and value_.
Referenced by ToNativeValue().
Value * CodegenAnyVal::GetUnloweredPtr | ( | ) |
Allocas and stores this value in an unlowered pointer, and returns the pointer. This *Val should be non-null.
Definition at line 445 of file codegen-anyval.cc.
References builder_, codegen_, impala::LlvmCodeGen::CreateEntryBlockAlloca(), GetUnloweredPtrType(), type_, and value_.
Referenced by Eq(), and EqToNativePtr().
|
static |
Returns the unlowered AnyVal pointer type associated with 'type'. E.g.: TYPE_BOOLEAN => %"struct.impala_udf::BooleanVal"*
Definition at line 112 of file codegen-anyval.cc.
Referenced by impala::PartitionedAggregationNode::CodegenUpdateSlot(), impala::ScalarFnCall::GetUdf(), and GetUnloweredPtr().
|
static |
Returns the unlowered AnyVal type associated with 'type'. E.g.: TYPE_BOOLEAN => %"struct.impala_udf::BooleanVal"
Definition at line 69 of file codegen-anyval.cc.
References impala::ColumnType::DebugString(), impala::LlvmCodeGen::GetType(), impala::ColumnType::type, impala::TYPE_BIGINT, impala::TYPE_BOOLEAN, impala::TYPE_CHAR, impala::TYPE_DECIMAL, impala::TYPE_DOUBLE, impala::TYPE_FLOAT, impala::TYPE_INT, impala::TYPE_SMALLINT, impala::TYPE_STRING, impala::TYPE_TIMESTAMP, impala::TYPE_TINYINT, and impala::TYPE_VARCHAR.
Referenced by impala::AggregationNode::CodegenUpdateSlot(), impala::ScalarFnCall::GetCodegendComputeFn(), and impala::ScalarFnCall::GetUdf().
Value * CodegenAnyVal::GetVal | ( | const char * | name = "val" | ) |
Get the 'val' field of the *Val. Do not call if this represents a StringVal or TimestampVal. If this represents a DecimalVal, returns 'val4', 'val8', or 'val16' depending on the precision of 'type_'. The returned value will have variable name 'name'.
Definition at line 258 of file codegen-anyval.cc.
References builder_, codegen_, impala::LlvmCodeGen::float_type(), impala::ColumnType::GetByteSize(), GetHighBits(), impala::LlvmCodeGen::GetType(), impala::name, impala::ColumnType::type, type_, impala::TYPE_BIGINT, impala::TYPE_BOOLEAN, impala::TYPE_CHAR, impala::TYPE_DECIMAL, impala::TYPE_DOUBLE, impala::TYPE_FLOAT, impala::TYPE_INT, impala::TYPE_SMALLINT, impala::TYPE_STRING, impala::TYPE_TIMESTAMP, impala::TYPE_TINYINT, impala::TYPE_VARCHAR, and value_.
Referenced by impala::CompoundPredicate::CodegenComputeFn(), impala::ExecNode::CodegenEvalConjuncts(), impala::AggregationNode::CodegenUpdateSlot(), impala::PartitionedAggregationNode::CodegenUpdateSlot(), impala::HdfsScanner::CodegenWriteCompleteTuple(), Eq(), EqToNativePtr(), impala::CaseExpr::GetCodegendComputeFn(), and ToNativeValue().
void CodegenAnyVal::SetDate | ( | llvm::Value * | date | ) |
Setters for TimestampVals.
Definition at line 437 of file codegen-anyval.cc.
References builder_, name_, SetHighBits(), impala::ColumnType::type, type_, impala::TYPE_TIMESTAMP, and value_.
Referenced by impala::SlotRef::GetCodegendComputeFn(), and SetFromRawValue().
void CodegenAnyVal::SetFromRawPtr | ( | llvm::Value * | raw_ptr | ) |
Set this Val's value based on void 'raw_ptr'. 'raw_ptr' should be a pointer to a native type, StringValue, or TimestampValue (i.e. the value returned by an interpreted compute fn).
Definition at line 451 of file codegen-anyval.cc.
References builder_, codegen_, impala::LlvmCodeGen::GetPtrType(), SetFromRawValue(), and type_.
void CodegenAnyVal::SetFromRawValue | ( | llvm::Value * | raw_val | ) |
Set this *Val's value based on 'raw_val'. 'raw_val' should be a native type, StringValue, or TimestampValue.
Definition at line 458 of file codegen-anyval.cc.
References builder_, codegen_, impala::ColumnType::DebugString(), impala::LlvmCodeGen::GetType(), impala::LlvmCodeGen::Print(), SetDate(), SetLen(), SetPtr(), SetTimeOfDay(), SetVal(), impala::ColumnType::type, type_, impala::TYPE_BIGINT, impala::TYPE_BOOLEAN, impala::TYPE_CHAR, impala::TYPE_DECIMAL, impala::TYPE_DOUBLE, impala::TYPE_FLOAT, impala::TYPE_INT, impala::TYPE_SMALLINT, impala::TYPE_STRING, impala::TYPE_TIMESTAMP, impala::TYPE_TINYINT, and impala::TYPE_VARCHAR.
Referenced by impala::AggregationNode::CodegenUpdateSlot(), impala::PartitionedAggregationNode::CodegenUpdateSlot(), and SetFromRawPtr().
|
private |
Helper function for setting the top (most significant) half of a 'dst' to 'src'. 'src' must have width <= 'num_bits' and 'dst' must have width = 'num_bits' * 2. Both 'dst' and 'src' should be integer types.
Definition at line 628 of file codegen-anyval.cc.
References builder_, codegen_, and impala::LlvmCodeGen::context().
void CodegenAnyVal::SetIsNull | ( | llvm::Value * | is_null | ) |
Sets the 'is_null' field of the *Val.
Definition at line 209 of file codegen-anyval.cc.
References builder_, codegen_, impala::ColumnType::DebugString(), name_, impala::LlvmCodeGen::tinyint_type(), impala::ColumnType::type, type_, impala::TYPE_BIGINT, impala::TYPE_BOOLEAN, impala::TYPE_CHAR, impala::TYPE_DECIMAL, impala::TYPE_DOUBLE, impala::TYPE_FLOAT, impala::TYPE_INT, impala::TYPE_SMALLINT, impala::TYPE_STRING, impala::TYPE_TIMESTAMP, impala::TYPE_TINYINT, impala::TYPE_VARCHAR, and value_.
Referenced by impala::CompoundPredicate::CodegenComputeFn(), and impala::SlotRef::GetCodegendComputeFn().
void CodegenAnyVal::SetLen | ( | llvm::Value * | len | ) |
Definition at line 410 of file codegen-anyval.cc.
References builder_, impala::ColumnType::IsStringType(), name_, SetHighBits(), type_, and value_.
Referenced by impala::SlotRef::GetCodegendComputeFn(), impala::Literal::GetCodegendComputeFn(), and SetFromRawValue().
void CodegenAnyVal::SetPtr | ( | llvm::Value * | ptr | ) |
Setters for StringVals.
Definition at line 404 of file codegen-anyval.cc.
References builder_, impala::ColumnType::IsStringType(), name_, type_, and value_.
Referenced by impala::SlotRef::GetCodegendComputeFn(), impala::Literal::GetCodegendComputeFn(), and SetFromRawValue().
void CodegenAnyVal::SetTimeOfDay | ( | llvm::Value * | time_of_day | ) |
Definition at line 431 of file codegen-anyval.cc.
References builder_, name_, impala::ColumnType::type, type_, impala::TYPE_TIMESTAMP, and value_.
Referenced by impala::SlotRef::GetCodegendComputeFn(), and SetFromRawValue().
void impala::CodegenAnyVal::SetVal | ( | llvm::Value * | val | ) |
Sets the 'val' field of the *Val. Do not call if this represents a StringVal or TimestampVal.
Referenced by impala::CompoundPredicate::CodegenComputeFn(), impala::SlotRef::GetCodegendComputeFn(), impala::Literal::GetCodegendComputeFn(), SetFromRawValue(), and SetVal().
void CodegenAnyVal::SetVal | ( | bool | val | ) |
Sets the 'val' field of the *Val. The *Val must correspond to the argument type.
Definition at line 345 of file codegen-anyval.cc.
References builder_, SetVal(), impala::ColumnType::type, type_, and impala::TYPE_BOOLEAN.
void CodegenAnyVal::SetVal | ( | int8_t | val | ) |
Definition at line 350 of file codegen-anyval.cc.
References builder_, SetVal(), impala::ColumnType::type, type_, and impala::TYPE_TINYINT.
void CodegenAnyVal::SetVal | ( | int16_t | val | ) |
Definition at line 355 of file codegen-anyval.cc.
References builder_, SetVal(), impala::ColumnType::type, type_, and impala::TYPE_SMALLINT.
void CodegenAnyVal::SetVal | ( | int32_t | val | ) |
Definition at line 360 of file codegen-anyval.cc.
References builder_, SetVal(), impala::ColumnType::type, type_, impala::TYPE_DECIMAL, and impala::TYPE_INT.
void CodegenAnyVal::SetVal | ( | int64_t | val | ) |
Definition at line 365 of file codegen-anyval.cc.
References builder_, SetVal(), impala::ColumnType::type, type_, impala::TYPE_BIGINT, and impala::TYPE_DECIMAL.
void CodegenAnyVal::SetVal | ( | int128_t | val | ) |
Definition at line 370 of file codegen-anyval.cc.
References builder_, codegen_, impala::HighBits(), impala::LlvmCodeGen::i128_type(), impala::LowBits(), SetVal(), impala::ColumnType::type, type_, and impala::TYPE_DECIMAL.
void CodegenAnyVal::SetVal | ( | float | val | ) |
Definition at line 381 of file codegen-anyval.cc.
References builder_, SetVal(), impala::ColumnType::type, type_, and impala::TYPE_FLOAT.
void CodegenAnyVal::SetVal | ( | double | val | ) |
Definition at line 386 of file codegen-anyval.cc.
References builder_, SetVal(), impala::ColumnType::type, type_, and impala::TYPE_DOUBLE.
void CodegenAnyVal::ToNativePtr | ( | llvm::Value * | native_ptr | ) |
Sets 'native_ptr' to this *Val's value. 'native_ptr' should be a pointer to a native type, StringValue, TimestampValue, etc. This should only be used if this *Val is not null.
Definition at line 547 of file codegen-anyval.cc.
References builder_, and ToNativeValue().
Referenced by impala::HashTableCtx::CodegenEvalRow(), and impala::OldHashTable::CodegenEvalTupleRow().
Value * CodegenAnyVal::ToNativeValue | ( | ) |
Converts this *Val's value to a native type, StringValue, TimestampValue, etc. This should only be used if this *Val is not null.
Definition at line 507 of file codegen-anyval.cc.
References builder_, codegen_, impala::ColumnType::DebugString(), GetDate(), GetLen(), GetPtr(), GetTimeOfDay(), impala::LlvmCodeGen::GetType(), GetVal(), impala::ColumnType::type, type_, impala::TYPE_BIGINT, impala::TYPE_BOOLEAN, impala::TYPE_DECIMAL, impala::TYPE_DOUBLE, impala::TYPE_FLOAT, impala::TYPE_INT, impala::TYPE_SMALLINT, impala::TYPE_STRING, impala::TYPE_TIMESTAMP, impala::TYPE_TINYINT, and impala::TYPE_VARCHAR.
Referenced by impala::AggregationNode::CodegenUpdateSlot(), impala::PartitionedAggregationNode::CodegenUpdateSlot(), and ToNativePtr().
|
inline |
Returns the current type-lowered value.
Definition at line 135 of file codegen-anyval.h.
References value_.
Referenced by impala::CompoundPredicate::CodegenComputeFn(), impala::AggregationNode::CodegenUpdateSlot(), impala::PartitionedAggregationNode::CodegenUpdateSlot(), impala::SlotRef::GetCodegendComputeFn(), and impala::Literal::GetCodegendComputeFn().
|
private |
Definition at line 220 of file codegen-anyval.h.
Referenced by Eq(), EqToNativePtr(), GetDate(), GetHighBits(), GetIsNull(), GetLen(), GetPtr(), GetTimeOfDay(), GetUnloweredPtr(), GetVal(), SetDate(), SetFromRawPtr(), SetFromRawValue(), SetHighBits(), SetIsNull(), SetLen(), SetPtr(), SetTimeOfDay(), SetVal(), ToNativePtr(), and ToNativeValue().
|
private |
Definition at line 219 of file codegen-anyval.h.
Referenced by Eq(), EqToNativePtr(), GetHighBits(), GetIsNull(), GetUnloweredPtr(), GetVal(), SetFromRawPtr(), SetFromRawValue(), SetHighBits(), SetIsNull(), SetVal(), and ToNativeValue().
|
static |
Definition at line 58 of file codegen-anyval.h.
|
static |
Definition at line 54 of file codegen-anyval.h.
|
static |
Definition at line 63 of file codegen-anyval.h.
Referenced by impala::LlvmCodeGen::AddFunctionToJit().
|
static |
Definition at line 60 of file codegen-anyval.h.
|
static |
Definition at line 59 of file codegen-anyval.h.
|
static |
Definition at line 57 of file codegen-anyval.h.
|
static |
Definition at line 56 of file codegen-anyval.h.
|
static |
Definition at line 61 of file codegen-anyval.h.
|
static |
Definition at line 62 of file codegen-anyval.h.
|
static |
Definition at line 55 of file codegen-anyval.h.
|
private |
Definition at line 217 of file codegen-anyval.h.
Referenced by GetPtr(), SetDate(), SetIsNull(), SetLen(), SetPtr(), and SetTimeOfDay().
|
private |
Definition at line 215 of file codegen-anyval.h.
Referenced by Eq(), EqToNativePtr(), GetDate(), GetIsNull(), GetLen(), GetPtr(), GetTimeOfDay(), GetUnloweredPtr(), GetVal(), SetDate(), SetFromRawPtr(), SetFromRawValue(), SetIsNull(), SetLen(), SetPtr(), SetTimeOfDay(), SetVal(), and ToNativeValue().
|
private |
Definition at line 216 of file codegen-anyval.h.
Referenced by GetDate(), GetIsNull(), GetLen(), GetPtr(), GetTimeOfDay(), GetUnloweredPtr(), GetVal(), SetDate(), SetIsNull(), SetLen(), SetPtr(), SetTimeOfDay(), and value().