Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
#include <types.h>
Public Member Functions | |
ColumnType (PrimitiveType type=INVALID_TYPE) | |
ColumnType (const TColumnType &t) | |
bool | operator== (const ColumnType &o) const |
bool | operator!= (const ColumnType &other) const |
TColumnType | ToThrift () const |
bool | IsStringType () const |
bool | IsVarLen () const |
int | GetByteSize () const |
Returns the byte size of this type. Returns 0 for variable length types. More... | |
int | GetSlotSize () const |
Returns the size of a slot for this type. More... | |
apache::hive::service::cli::thrift::TTypeEntry | ToHs2Type () const |
std::string | DebugString () const |
Static Public Member Functions | |
static ColumnType | CreateCharType (int len) |
static ColumnType | CreateVarcharType (int len) |
static ColumnType | CreateDecimalType (int precision, int scale) |
static int | GetDecimalByteSize (int precision) |
Public Attributes | |
PrimitiveType | type |
int | len |
Only set if type == TYPE_CHAR or type == TYPE_VARCHAR. More... | |
int | precision |
Only set if type == TYPE_DECIMAL. More... | |
int | scale |
Static Public Attributes | |
static const int | MAX_VARCHAR_LENGTH = 65355 |
static const int | MAX_CHAR_LENGTH = 255 |
static const int | MAX_CHAR_INLINE_LENGTH = 128 |
static const int | MAX_PRECISION = 38 |
Must be kept in sync with FE's max precision/scale. More... | |
static const int | MAX_SCALE = MAX_PRECISION |
static const int | MAX_DECIMAL4_PRECISION = 9 |
The maximum precision representable by a 4-byte decimal (Decimal4Value) More... | |
static const int | MAX_DECIMAL8_PRECISION = 18 |
The maximum precision representable by a 8-byte decimal (Decimal8Value) More... | |
Wrapper struct to describe a type. Includes the enum and, optionally, size information. TODO: Rename to ScalarType and mirror FE type hierarchy after the expr refactoring.
|
inline |
Definition at line 79 of file types.h.
References type, impala::TYPE_CHAR, and impala::TYPE_DECIMAL.
|
inline |
Definition at line 115 of file types.h.
References len, precision, scale, impala::ThriftToType(), type, impala::TYPE_CHAR, impala::TYPE_DECIMAL, and impala::TYPE_VARCHAR.
|
inlinestatic |
Definition at line 85 of file types.h.
References len, MAX_CHAR_LENGTH, type, and impala::TYPE_CHAR.
Referenced by impala::HdfsAvroScanner::ReadAvroChar(), impala::TEST(), and impala::TEST_F().
|
inlinestatic |
Definition at line 103 of file types.h.
References MAX_PRECISION, MAX_SCALE, precision, scale, type, and impala::TYPE_DECIMAL.
Referenced by impala::AggregateFunctions::DecimalAvgGetValue(), impala::GetResultType(), impala::TEST(), and TestImpala().
|
inlinestatic |
Definition at line 94 of file types.h.
References len, MAX_VARCHAR_LENGTH, type, and impala::TYPE_VARCHAR.
string impala::ColumnType::DebugString | ( | ) | const |
Definition at line 194 of file types.cc.
References impala::TYPE_CHAR, impala::TYPE_DECIMAL, and impala::TypeToString().
Referenced by AppendAnyValType(), impala::RawValue::Compare(), impala::Literal::CreateLiteral(), impala::Literal::DebugString(), impala::SlotDescriptor::DebugString(), impala::Expr::DebugString(), impala::AggregateFunctions::DecimalAvgAddOrRemove(), impala::CodegenAnyVal::Eq(), impala::CodegenAnyVal::EqToNativePtr(), impala::Literal::GetCodegendComputeFn(), impala::Literal::GetDecimalVal(), impala::Expr::GetStaticGetValWrapper(), impala::CodegenAnyVal::GetUnloweredType(), impala::ExprContext::GetValue(), impala::Literal::Literal(), impala::operator<<(), impala::RawValue::PrintValueAsBytes(), ResolveSymbolLookup(), impala::CodegenAnyVal::SetFromRawValue(), impala::CodegenAnyVal::SetIsNull(), impala::CodegenAnyVal::ToNativeValue(), impala::HdfsParquetScanner::ValidateColumn(), and impala::RawValue::Write().
|
inline |
Returns the byte size of this type. Returns 0 for variable length types.
Definition at line 178 of file types.h.
References GetDecimalByteSize(), impala::INVALID_TYPE, IsVarLen(), len, precision, type, impala::TYPE_BIGINT, impala::TYPE_BOOLEAN, impala::TYPE_CHAR, impala::TYPE_DATE, 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::DecimalFunctions::Abs(), impala::DecimalOperators::CastToBooleanVal(), impala::DecimalOperators::CastToDecimalVal(), impala::DecimalOperators::CastToStringVal(), impala::DecimalOperators::CastToTimestampVal(), impala::HdfsAvroScanner::CodegenMaterializeTuple(), impala::RawValue::Compare(), impala::ExprTest::ConvertValue(), impala::HdfsParquetScanner::CreateReader(), impala::AggregateFunctions::DecimalAvgAddOrRemove(), impala::RawValue::Eq(), impala::DecimalOperators::FloatToDecimalVal(), impala::UtilityFunctions::FnvHashDecimal(), impala::Literal::GetCodegendComputeFn(), impala::GetDecimal16Value(), impala::GetDecimal4Value(), impala::GetDecimal8Value(), impala::SlotRef::GetDecimalVal(), impala::RawValue::GetHashValue(), impala::RawValue::GetHashValueFnv(), impala::HBaseTableScanner::GetRowKey(), GetSlotSize(), impala::LlvmCodeGen::GetType(), impala::CodegenAnyVal::GetVal(), impala::ExprContext::GetValue(), impala::HdfsParquetTableWriter::Init(), impala::DecimalOperators::IntToDecimalVal(), impala::MathFunctions::LeastGreatest(), impala::HdfsAvroScanner::MaterializeTuple(), impala::MathFunctions::Negative(), impala::ConditionalFunctions::NullIfZero(), impala::RawValue::PrintValue(), impala::RawValue::PrintValueAsBytes(), impala::DecimalOperators::RoundDecimal(), impala::DecimalOperators::ScaleDecimalValue(), impala::AnyValUtil::SetAnyVal(), impala::SetDecimalVal(), impala::AggFnEvaluator::SetDstSlot(), impala::TEST_F(), impala::RawValue::Write(), impala::KeyNormalizer::WriteNormalizedKey(), and impala::HBaseTableScanner::WriteTupleSlot().
|
inlinestatic |
Definition at line 225 of file types.h.
References MAX_DECIMAL4_PRECISION, and MAX_DECIMAL8_PRECISION.
Referenced by impala::HdfsAvroTableWriter::AppendField(), and GetByteSize().
|
inline |
Returns the size of a slot for this type.
Definition at line 212 of file types.h.
References GetByteSize(), IsVarLen(), len, type, impala::TYPE_CHAR, impala::TYPE_STRING, and impala::TYPE_VARCHAR.
Referenced by impala::HiveUdfCall::Open(), and impala::HiveUdfCall::Prepare().
|
inline |
Definition at line 168 of file types.h.
References type, impala::TYPE_CHAR, impala::TYPE_STRING, and impala::TYPE_VARCHAR.
Referenced by impala::CodegenAnyVal::EqToNativePtr(), impala::SlotRef::GetCodegendComputeFn(), impala::CodegenAnyVal::GetLen(), impala::CodegenAnyVal::GetPtr(), impala::SlotRef::GetStringVal(), impala::Literal::GetStringVal(), impala::ScalarFnCall::GetStringVal(), impala::CodegenAnyVal::SetLen(), impala::CodegenAnyVal::SetPtr(), impala::HdfsAvroScanner::VerifyTypesMatch(), and impala::TextConverter::WriteSlot().
|
inline |
Definition at line 172 of file types.h.
References len, MAX_CHAR_INLINE_LENGTH, type, impala::TYPE_CHAR, impala::TYPE_STRING, and impala::TYPE_VARCHAR.
Referenced by impala::TupleDescriptor::AddSlot(), impala::HdfsTextTableWriter::AppendRowBatch(), impala::StringValue::CharSlotToPtr(), impala::TextConverter::CodegenWriteSlot(), GetByteSize(), GetSlotSize(), impala::ExprContext::GetValue(), impala::Tuple::MaterializeExprs(), impala::HdfsAvroScanner::ReadAvroChar(), impala::AnyValUtil::SetAnyVal(), impala::RawValue::Write(), and impala::TextConverter::WriteSlot().
|
inline |
|
inline |
Definition at line 136 of file types.h.
References len, precision, scale, type, impala::TYPE_CHAR, and impala::TYPE_DECIMAL.
TTypeEntry impala::ColumnType::ToHs2Type | ( | ) | const |
Definition at line 120 of file types.cc.
References impala_udf::DebugString(), impala::TYPE_BIGINT, impala::TYPE_BINARY, impala::TYPE_BOOLEAN, impala::TYPE_CHAR, 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::ImpalaServer::GetResultSetMetadata().
|
inline |
Definition at line 147 of file types.h.
References len, precision, scale, impala::ToThrift(), type, impala::TYPE_CHAR, impala::TYPE_DECIMAL, and impala::TYPE_VARCHAR.
Referenced by impala::DataStreamTest::CreateRowDesc(), impala::MakeSlotDescriptor(), and impala::DataSourceScanNode::Open().
int impala::ColumnType::len |
Only set if type == TYPE_CHAR or type == TYPE_VARCHAR.
Definition at line 62 of file types.h.
Referenced by impala::HdfsTextTableWriter::AppendRowBatch(), impala::CastFunctions::CastToChar(), impala::StringValue::CharSlotToPtr(), impala::HdfsAvroScanner::CodegenMaterializeTuple(), impala::TextConverter::CodegenWriteSlot(), impala::HdfsParquetScanner::ColumnReader< T >::ColumnReader(), ColumnType(), impala::AnyValUtil::ColumnTypeToTypeDesc(), impala::RawValue::Compare(), CreateCharType(), CreateVarcharType(), impala::RawValue::Eq(), GetByteSize(), impala::RawValue::GetHashValue(), impala::RawValue::GetHashValueFnv(), GetSlotSize(), impala::SlotRef::GetStringVal(), impala::ExprContext::GetValue(), impala::AggFnEvaluator::Init(), IsVarLen(), impala::Literal::Literal(), impala::HdfsAvroScanner::MaterializeTuple(), operator==(), impala::RawValue::PrintValue(), impala::RawValue::PrintValueAsBytes(), impala::AnyValUtil::SetAnyVal(), ToThrift(), impala::AnyValUtil::TruncateIfNecessary(), impala::RawValue::Write(), and impala::TextConverter::WriteSlot().
|
static |
Definition at line 65 of file types.h.
Referenced by IsVarLen().
|
static |
Definition at line 64 of file types.h.
Referenced by CreateCharType().
|
static |
The maximum precision representable by a 4-byte decimal (Decimal4Value)
Definition at line 75 of file types.h.
Referenced by GetDecimalByteSize(), impala::DecimalUtil::GetScaleMultiplier(), and main().
|
static |
The maximum precision representable by a 8-byte decimal (Decimal8Value)
Definition at line 77 of file types.h.
Referenced by GetDecimalByteSize(), impala::DecimalUtil::GetScaleMultiplier(), and main().
|
static |
Must be kept in sync with FE's max precision/scale.
Definition at line 71 of file types.h.
Referenced by CreateDecimalType(), impala::DecimalUtil::GetScaleMultiplier(), impala::DecimalUtil::InitMaxUnscaledDecimal(), and main().
|
static |
Definition at line 72 of file types.h.
Referenced by CreateDecimalType().
|
static |
Definition at line 63 of file types.h.
Referenced by CreateVarcharType().
int impala::ColumnType::precision |
Only set if type == TYPE_DECIMAL.
Definition at line 68 of file types.h.
Referenced by impala::HdfsAvroTableWriter::AppendField(), ColumnType(), impala::AnyValUtil::ColumnTypeToTypeDesc(), CreateDecimalType(), impala::ParquetPlainEncoder::DecimalSize(), impala::AnyValUtil::Equals(), impala::DecimalValue< int128_t >::FromDouble(), impala::DecimalValue< int128_t >::FromInt(), GetByteSize(), impala::GetResultType(), operator==(), impala::DecimalValue< int128_t >::ScaleTo(), impala::StringParser::StringToDecimal(), impala::DecimalValue< T >::ToString(), ToThrift(), impala::HdfsParquetScanner::ValidateColumn(), and impala::HdfsAvroScanner::VerifyTypesMatch().
int impala::ColumnType::scale |
Definition at line 68 of file types.h.
Referenced by impala::DecimalValue< int128_t >::Add(), impala::DecimalValue< int128_t >::AdjustToSameScale(), ColumnType(), impala::AnyValUtil::ColumnTypeToTypeDesc(), CreateDecimalType(), impala::DecimalValue< int128_t >::Divide(), impala::DecimalValue< int128_t >::fractional_part(), impala::DecimalValue< int128_t >::FromDouble(), impala::DecimalValue< int128_t >::FromInt(), impala::GetResultType(), impala::DecimalValue< int128_t >::Mod(), impala::DecimalValue< int128_t >::Multiply(), impala::DecimalUtil::MultiplyByScale(), operator==(), impala::DecimalOperators::RoundDecimal(), impala::DecimalValue< int128_t >::ScaleTo(), impala::StringParser::StringToDecimal(), impala::TEST(), impala::DecimalValue< int128_t >::ToDouble(), impala::DecimalValue< T >::ToString(), ToThrift(), impala::HdfsParquetScanner::ValidateColumn(), impala::HdfsAvroScanner::VerifyTypesMatch(), and impala::DecimalValue< int128_t >::whole_part().
PrimitiveType impala::ColumnType::type |
Definition at line 60 of file types.h.
Referenced by impala::CaseExpr::AnyValEq(), impala::AnyValUtil::AnyValSize(), AppendAnyValType(), impala::HdfsAvroTableWriter::AppendField(), impala::HdfsTextTableWriter::AppendRowBatch(), impala::HdfsParquetTableWriter::BoolColumnWriter::BoolColumnWriter(), impala::ParquetPlainEncoder::ByteSize(), impala::DecimalOperators::CastToBooleanVal(), impala::CastFunctions::CastToChar(), impala::DecimalOperators::CastToTimestampVal(), impala::StringValue::CharSlotToPtr(), CodegenAssignNullValue(), impala::HdfsAvroScanner::CodegenMaterializeTuple(), impala::LlvmCodeGen::CodegenMinMax(), impala::AggregationNode::CodegenUpdateSlot(), impala::PartitionedAggregationNode::CodegenUpdateSlot(), impala::AggregationNode::CodegenUpdateTuple(), impala::PartitionedAggregationNode::CodegenUpdateTuple(), impala::HdfsScanner::CodegenWriteCompleteTuple(), impala::TextConverter::CodegenWriteSlot(), impala::HdfsParquetScanner::ColumnReader< T >::ColumnReader(), ColumnType(), impala::AnyValUtil::ColumnTypeToTypeDesc(), impala::HdfsParquetTableWriter::ColumnWriter< T >::ColumnWriter(), impala::RawValue::Compare(), impala::ExprTest::ConvertValue(), impala::CreateAnyVal(), CreateCharType(), CreateDecimalType(), impala::Literal::CreateLiteral(), impala::HdfsParquetScanner::CreateReader(), impala::HdfsParquetTableWriter::CreateSchema(), CreateVarcharType(), impala::Literal::DebugString(), impala::ParquetPlainEncoder::DecimalSize(), impala::RawValue::Eq(), impala::CodegenAnyVal::Eq(), impala::CodegenAnyVal::EqToNativePtr(), impala::DecimalOperators::FloatToDecimalVal(), impala::TupleDescriptor::GenerateLlvmStruct(), impala::SlotRef::GetBigIntVal(), impala::Literal::GetBigIntVal(), impala::HiveUdfCall::GetBigIntVal(), impala::ScalarFnCall::GetBigIntVal(), impala::SlotRef::GetBooleanVal(), impala::Literal::GetBooleanVal(), impala::HiveUdfCall::GetBooleanVal(), impala::ScalarFnCall::GetBooleanVal(), GetByteSize(), impala::SlotRef::GetCodegendComputeFn(), impala::Literal::GetCodegendComputeFn(), impala::ScalarFnCall::GetCodegendComputeFn(), impala::Expr::GetConstVal(), impala::CodegenAnyVal::GetDate(), impala::GetDecimal16Value(), impala::GetDecimal4Value(), impala::GetDecimal8Value(), impala::SlotRef::GetDecimalVal(), impala::Literal::GetDecimalVal(), impala::HiveUdfCall::GetDecimalVal(), impala::ScalarFnCall::GetDecimalVal(), impala::SlotRef::GetDoubleVal(), impala::Literal::GetDoubleVal(), impala::HiveUdfCall::GetDoubleVal(), impala::ScalarFnCall::GetDoubleVal(), impala::SlotRef::GetFloatVal(), impala::Literal::GetFloatVal(), impala::ScalarFnCall::GetFloatVal(), impala::HiveUdfCall::GetFloatVal(), impala::RawValue::GetHashValue(), impala::RawValue::GetHashValueFnv(), impala::GetHllUpdateFunction2(), impala::SlotRef::GetIntVal(), impala::Literal::GetIntVal(), impala::HiveUdfCall::GetIntVal(), impala::ScalarFnCall::GetIntVal(), impala::CodegenAnyVal::GetIsNull(), impala::CodegenAnyVal::GetLoweredType(), impala::Sorter::Run::GetNext(), GetSlotSize(), impala::SlotRef::GetSmallIntVal(), impala::Literal::GetSmallIntVal(), impala::HiveUdfCall::GetSmallIntVal(), impala::ScalarFnCall::GetSmallIntVal(), impala::Expr::GetStaticGetValWrapper(), impala::SlotRef::GetStringVal(), impala::HiveUdfCall::GetStringVal(), impala::CodegenAnyVal::GetTimeOfDay(), impala::SlotRef::GetTimestampVal(), impala::HiveUdfCall::GetTimestampVal(), impala::ScalarFnCall::GetTimestampVal(), impala::SlotRef::GetTinyIntVal(), impala::Literal::GetTinyIntVal(), impala::ScalarFnCall::GetTinyIntVal(), impala::HiveUdfCall::GetTinyIntVal(), impala::LlvmCodeGen::GetType(), impala::CodegenAnyVal::GetUnloweredType(), impala::CodegenAnyVal::GetVal(), impala::ExprContext::GetValue(), impala::ExprTest::GetValue(), impala::HdfsParquetTableWriter::Init(), impala::AggFnEvaluator::intermediate_type(), impala::DecimalOperators::IntToDecimalVal(), IsStringType(), IsVarLen(), impala::Literal::Literal(), impala::SymbolsUtil::MangleUserFunction(), impala::Tuple::MaterializeExprs(), impala::DataSourceScanNode::MaterializeNextRow(), impala::HdfsAvroScanner::MaterializeTuple(), impala::DecimalUtil::MultiplyByScale(), impala::ScalarFnCall::Open(), operator==(), impala::AggregationNode::Prepare(), impala::AggFnEvaluator::Prepare(), impala::PartitionedAggregationNode::Prepare(), impala::Expr::Prepare(), impala::RawValue::PrintValue(), impala::RawValue::PrintValueAsBytes(), impala::DecimalOperators::RoundDecimal(), impala::DecimalOperators::ScaleDecimalValue(), impala::AggFnEvaluator::SerializeOrFinalize(), impala::AnyValUtil::SetAnyVal(), impala::CodegenAnyVal::SetDate(), impala::AggFnEvaluator::SetDstSlot(), impala::CodegenAnyVal::SetFromRawValue(), impala::CodegenAnyVal::SetIsNull(), impala::CodegenAnyVal::SetTimeOfDay(), impala::ExprValue::SetToMax(), impala::ExprValue::SetToMin(), impala::ExprValue::SetToZero(), impala::CodegenAnyVal::SetVal(), impala::TEST_F(), impala::ExprTest::TestValue(), impala::CodegenAnyVal::ToNativeValue(), impala::DecimalValue< T >::ToString(), ToThrift(), impala::AnyValUtil::TruncateIfNecessary(), impala::HdfsParquetTableWriter::BaseColumnWriter::type(), impala::UtilityFunctions::TypeOf(), impala::HdfsParquetScanner::ValidateColumn(), impala::HdfsAvroScanner::VerifyTypesMatch(), impala::RawValue::Write(), impala::KeyNormalizer::WriteNormalizedKey(), and impala::TextConverter::WriteSlot().