Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
#include <string-value.h>
Public Member Functions | |
StringValue (char *ptr, int len) | |
StringValue () | |
StringValue (const std::string &s) | |
StringValue (const char *s) | |
int | Compare (const StringValue &other) const |
bool | Eq (const StringValue &other) const |
== More... | |
bool | operator== (const StringValue &other) const |
bool | Ne (const StringValue &other) const |
!= More... | |
bool | operator!= (const StringValue &other) const |
bool | Le (const StringValue &other) const |
<= More... | |
bool | operator<= (const StringValue &other) const |
bool | Ge (const StringValue &other) const |
>= More... | |
bool | operator>= (const StringValue &other) const |
bool | Lt (const StringValue &other) const |
< More... | |
bool | operator< (const StringValue &other) const |
bool | Gt (const StringValue &other) const |
> More... | |
bool | operator> (const StringValue &other) const |
std::string | DebugString () const |
StringValue | Substring (int start_pos) const |
Returns the substring starting at start_pos until the end of string. More... | |
StringValue | Substring (int start_pos, int new_len) const |
StringValue | Trim () const |
Trims leading and trailing spaces. More... | |
void | ToStringVal (impala_udf::StringVal *sv) const |
Static Public Member Functions | |
static StringValue | FromStringVal (const impala_udf::StringVal &sv) |
static void | PadWithSpaces (char *cptr, int64_t cptr_len, int64_t num_chars) |
static int64_t | UnpaddedCharLength (const char *cptr, int64_t len) |
Returns number of characters in a char array (ignores trailing spaces) More... | |
static char * | CharSlotToPtr (void *slot, const ColumnType &type) |
static const char * | CharSlotToPtr (const void *slot, const ColumnType &type) |
Public Attributes | |
char * | ptr |
int | len |
Static Public Attributes | |
static const char * | LLVM_CLASS_NAME = "struct.impala::StringValue" |
For C++/IR interop, we need to be able to look up types by name. More... | |
The format of a string-typed slot. The returned StringValue of all functions that return StringValue shares its buffer the parent. TODO: rename this to be less confusing with impala_udf::StringVal.
Definition at line 33 of file string-value.h.
|
inline |
Definition at line 40 of file string-value.h.
|
inline |
Definition at line 43 of file string-value.h.
Referenced by FromStringVal(), Substring(), and Trim().
|
inline |
Construct a StringValue from 's'. 's' must be valid for as long as this object is valid.
Definition at line 47 of file string-value.h.
|
inline |
Construct a StringValue from 's'. 's' must be valid for as long as this object is valid. s must be a null-terminated string. This constructor is to prevent accidental use of the version taking an std::string.
Definition at line 55 of file string-value.h.
|
inlinestatic |
Converts a char slot to a pointer to the char string. The slot should be a StringValue* or a char*, determined by type.IsVarLen() Returns NULL if the slot is null.
Definition at line 115 of file string-value.inline.h.
References impala::ColumnType::IsVarLen(), len, impala::ColumnType::len, ptr, impala::ColumnType::type, and impala::TYPE_CHAR.
Referenced by impala::HdfsTextTableWriter::AppendRowBatch(), impala::HdfsParquetTableWriter::ColumnWriter< T >::CastValue(), impala::RawValue::Compare(), impala::RawValue::Eq(), impala::RawValue::GetHashValue(), impala::RawValue::GetHashValueFnv(), impala::SlotRef::GetStringVal(), impala::ExprContext::GetValue(), impala::AggFnEvaluator::Init(), impala::RawValue::PrintValue(), impala::RawValue::PrintValueAsBytes(), and impala::RawValue::Write().
|
inlinestatic |
Definition at line 126 of file string-value.inline.h.
References impala::ColumnType::IsVarLen(), len, impala::ColumnType::len, ptr, impala::ColumnType::type, and impala::TYPE_CHAR.
|
inline |
Byte-by-byte comparison. Returns: this < other: -1 this == other: 0 this > other: 1
Definition at line 59 of file string-value.inline.h.
References len, ptr, and impala::StringCompare().
Referenced by impala::RawValue::Compare(), Ge(), Gt(), Le(), and Lt().
string impala::StringValue::DebugString | ( | ) | const |
Definition at line 24 of file string-value.cc.
Referenced by impala::TimestampFunctions::FromUtc(), impala::operator<<(), impala::TimestampFunctions::ReportBadFormat(), and impala::TimestampFunctions::ToUtc().
|
inline |
==
Definition at line 74 of file string-value.inline.h.
References len, ptr, and impala::StringCompare().
Referenced by impala::LikePredicate::ConstantEndsWithFn(), impala::LikePredicate::ConstantEqualsFn(), impala::LikePredicate::ConstantStartsWithFn(), impala::RawValue::Eq(), impala::StringFunctions::FindInSet(), impala::UrlParser::GetUrlPart(), Ne(), and operator==().
|
inlinestatic |
Definition at line 103 of file string-value.h.
References impala_udf::StringVal::len, impala_udf::StringVal::ptr, and StringValue().
Referenced by impala::LikePredicate::ConstantEqualsFn(), impala::LikePredicate::ConstantSubstringFn(), impala::MathFunctions::LeastGreatest(), impala::LikePredicate::LikePrepare(), impala::AggregateFunctions::Max(), impala::AggregateFunctions::Min(), and impala::AggFnEvaluator::SetDstSlot().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 70 of file string-value.h.
References Ne().
|
inline |
Definition at line 79 of file string-value.h.
References Lt().
|
inline |
Definition at line 73 of file string-value.h.
References Le().
|
inline |
Definition at line 67 of file string-value.h.
References Eq().
|
inline |
Definition at line 82 of file string-value.h.
References Gt().
|
inline |
Definition at line 76 of file string-value.h.
References Ge().
|
inlinestatic |
Pads the end of the char pointer with spaces. num_chars is the number of used characters, cptr_len is the length of cptr
Definition at line 100 of file string-value.inline.h.
Referenced by impala::CastFunctions::CastToChar(), impala::HdfsParquetScanner::ColumnReader< T >::ConvertSlot(), impala::HdfsAvroScanner::ReadAvroChar(), impala::TEST(), and impala::TextConverter::WriteSlot().
|
inline |
Returns the substring starting at start_pos until the end of string.
Definition at line 79 of file string-value.inline.h.
References len, ptr, and StringValue().
Referenced by impala::UrlParser::ParseUrl(), and impala::UrlParser::ParseUrlKey().
|
inline |
Returns the substring starting at start_pos with given length. If new_len < 0 then the substring from start_pos to end of string is returned. If new_len > len, len is extended to new_len. TODO: len should never be extended. This is not a trivial fix because UrlParser depends on the current behavior.
Definition at line 83 of file string-value.inline.h.
References len, ptr, and StringValue().
|
inline |
Definition at line 99 of file string-value.h.
Referenced by impala::SlotRef::GetStringVal(), impala::Literal::GetStringVal(), impala::MathFunctions::LeastGreatest(), impala::StringFunctions::ParseUrl(), and impala::StringFunctions::ParseUrlKey().
|
inline |
Trims leading and trailing spaces.
Definition at line 87 of file string-value.inline.h.
References len, ptr, and StringValue().
Referenced by impala::UrlParser::ParseUrl(), and impala::UrlParser::ParseUrlKey().
|
inlinestatic |
Returns number of characters in a char array (ignores trailing spaces)
Definition at line 107 of file string-value.inline.h.
Referenced by impala::HdfsTextTableWriter::AppendRowBatch(), impala::HdfsParquetTableWriter::ColumnWriter< T >::CastValue(), impala::RawValue::Compare(), impala::RawValue::Eq(), and impala::TEST().
int impala::StringValue::len |
Definition at line 38 of file string-value.h.
Referenced by impala::DictEncoder< T >::AddToTable(), impala::StringBuffer::Append(), impala::HdfsAvroTableWriter::AppendField(), impala::SimpleTupleStreamTest::AppendValue(), impala::ParquetPlainEncoder::ByteSize(), CharSlotToPtr(), impala::StringBuffer::Clear(), impala::Sorter::Run::CollectNonNullVarSlots(), Compare(), impala::BufferedTupleStream::ComputeRowSize(), impala::LikePredicate::ConstantEndsWithFn(), impala::LikePredicate::ConstantStartsWithFn(), impala::LikePredicate::ConstantSubstringFn(), impala::PartitionedAggregationNode::ConstructIntermediateTuple(), impala::HdfsParquetScanner::ColumnReader< T >::ConvertSlot(), impala::HdfsParquetScanner::ColumnReader< T >::CopySlot(), impala::Sorter::Run::CopyVarLenData(), impala::Sorter::Run::CopyVarLenDataConvertOffset(), DebugString(), impala::ParquetPlainEncoder::Decode(), impala::Tuple::DeepCopy(), impala::BufferedTupleStream::DeepCopyInternal(), impala::StringBuffer::Empty(), impala::ParquetPlainEncoder::Encode(), Eq(), impala::ExprValue::ExprValue(), impala::HdfsTextScanner::FinishScanRange(), impala::Literal::GetCodegendComputeFn(), impala::RawValue::GetHashValue(), impala::RawValue::GetHashValueFnv(), impala::BufferedTupleStream::GetNextInternal(), impala::ExprContext::GetValue(), impala::StringBuffer::GrowBuffer(), impala::DictEncoder< T >::Hash(), impala::hash_value(), impala::HashTableCtx::HashVariableLenRow(), impala::OldHashTable::HashVariableLenRow(), impala::LikePredicate::LikePrepare(), impala::Literal::Literal(), impala::Tuple::MaterializeExprs(), impala::UrlParser::ParseUrl(), impala::UrlParser::ParseUrlKey(), impala::HdfsTextTableWriter::PrintEscaped(), impala::RawValue::PrintValue(), impala::RawValue::PrintValueAsBytes(), RandString(), impala::HdfsAvroScanner::ReadAvroChar(), impala::HdfsAvroScanner::ReadAvroString(), impala::HdfsAvroScanner::ReadAvroVarchar(), impala::StringBuffer::Reset(), impala::StringSearchSSE::Search(), impala::StringSearch::Search(), impala::StringBuffer::Size(), impala::StringBuffer::StringBuffer(), impala::StringSearch::StringSearch(), impala::StringSearchSSE::StringSearchSSE(), Substring(), impala::TEST(), impala::TEST_F(), TestBoostMixedHash(), impala::ExprTest::TestCharValue(), TestCrcMixedHash(), TestFnvMixedHash(), TestImpala(), TestImpalaCased(), TestImpalaUnrolled(), TestImpalaUnsafe(), TestNormalStringsRandom(), TestNormalStringsSequential(), impala::ExprTest::TestStringValue(), ToStringVal(), impala::RowBatch::TotalByteSize(), Trim(), impala::TextConverter::UnescapeString(), impala::TimestampFunctions::UnixAndFromUnixPrepare(), impala::RawValue::Write(), impala::HdfsSequenceTableWriter::WriteEscapedString(), impala::KeyNormalizer::WriteNormalizedKey(), and impala::TextConverter::WriteSlot().
|
static |
For C++/IR interop, we need to be able to look up types by name.
Definition at line 121 of file string-value.h.
Referenced by impala::LlvmCodeGen::LoadImpalaIR().
char* impala::StringValue::ptr |
TODO: change ptr to an offset relative to a contiguous memory block, so that we can send row batches between nodes without having to swizzle pointers
Definition at line 37 of file string-value.h.
Referenced by impala::DictEncoder< T >::AddToTable(), impala::StringBuffer::Append(), impala::HdfsAvroTableWriter::AppendField(), impala::SimpleTupleStreamTest::AppendValue(), CharSlotToPtr(), Compare(), impala::HdfsParquetScanner::ColumnReader< T >::ConvertSlot(), impala::HdfsTextScanner::CopyBoundaryField(), impala::HdfsParquetScanner::ColumnReader< T >::CopySlot(), impala::Sorter::Run::CopyVarLenData(), impala::Sorter::Run::CopyVarLenDataConvertOffset(), DebugString(), impala::ParquetPlainEncoder::Decode(), impala::Tuple::DeepCopy(), impala::BufferedTupleStream::DeepCopyInternal(), impala::ParquetPlainEncoder::Encode(), Eq(), impala::ExprValue::ExprValue(), impala::HdfsTextScanner::FinishScanRange(), impala::Literal::GetCodegendComputeFn(), impala::RawValue::GetHashValue(), impala::RawValue::GetHashValueFnv(), impala::BufferedTupleStream::GetNextInternal(), impala::UrlParser::GetUrlPart(), impala::ExprContext::GetValue(), impala::StringBuffer::GrowBuffer(), impala::DictEncoder< T >::Hash(), impala::hash_value(), impala::HashTableCtx::HashVariableLenRow(), impala::OldHashTable::HashVariableLenRow(), impala::LikePredicate::LikePrepare(), impala::UrlParser::ParseUrl(), impala::UrlParser::ParseUrlKey(), impala::HdfsTextTableWriter::PrintEscaped(), impala::RawValue::PrintValue(), impala::RawValue::PrintValueAsBytes(), RandString(), impala::HdfsAvroScanner::ReadAvroChar(), impala::HdfsAvroScanner::ReadAvroString(), impala::HdfsAvroScanner::ReadAvroVarchar(), impala::StringSearchSSE::Search(), impala::StringSearch::Search(), impala::StringSearch::StringSearch(), Substring(), impala::TEST_F(), TestBoostMixedHash(), impala::ExprTest::TestCharValue(), TestCrcMixedHash(), TestFnvMixedHash(), TestImpala(), TestImpalaCased(), TestImpalaUnrolled(), TestImpalaUnsafe(), TestNormalStringsRandom(), TestNormalStringsSequential(), impala::ExprTest::TestStringValue(), ToStringVal(), Trim(), impala::TextConverter::UnescapeString(), impala::TimestampFunctions::UnixAndFromUnixPrepare(), impala::ValidateString(), impala::RawValue::Write(), impala::HdfsSequenceTableWriter::WriteEscapedString(), impala::KeyNormalizer::WriteNormalizedKey(), and impala::TextConverter::WriteSlot().