Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
#include <descriptors.h>
Public Member Functions | |
RowDescriptor (const DescriptorTbl &desc_tbl, const std::vector< TTupleId > &row_tuples, const std::vector< bool > &nullable_tuples) | |
RowDescriptor (const RowDescriptor &desc) | |
standard copy c'tor, made explicit here More... | |
RowDescriptor (const RowDescriptor &lhs_row_desc, const RowDescriptor &rhs_row_desc) | |
c'tor for a row assembled from two rows More... | |
RowDescriptor (const std::vector< TupleDescriptor * > &tuple_descs, const std::vector< bool > &nullable_tuples) | |
RowDescriptor (TupleDescriptor *tuple_desc, bool is_nullable) | |
RowDescriptor () | |
dummy descriptor, needed for the JNI EvalPredicate() function More... | |
int | GetRowSize () const |
int | GetTupleIdx (TupleId id) const |
Returns INVALID_IDX if id not part of this row. More... | |
bool | TupleIsNullable (int tuple_idx) const |
Return true if the Tuple of the given Tuple index is nullable. More... | |
bool | IsAnyTupleNullable () const |
Return true if any Tuple of the row is nullable. More... | |
const std::vector < TupleDescriptor * > & | tuple_descriptors () const |
Return descriptors for all tuples in this row, in order of appearance. More... | |
void | ToThrift (std::vector< TTupleId > *row_tuple_ids) |
Populate row_tuple_ids with our ids. More... | |
bool | IsPrefixOf (const RowDescriptor &other_desc) const |
bool | Equals (const RowDescriptor &other_desc) const |
Return true if the tuple ids of this descriptor match tuple ids of other desc. More... | |
std::string | DebugString () const |
Static Public Attributes | |
static const int | INVALID_IDX = -1 |
Private Member Functions | |
void | InitTupleIdxMap () |
Initializes tupleIdxMap during c'tor using the tuple_desc_map_. More... | |
Private Attributes | |
std::vector< TupleDescriptor * > | tuple_desc_map_ |
map from position of tuple w/in row to its descriptor More... | |
std::vector< bool > | tuple_idx_nullable_map_ |
tuple_idx_nullable_map_[i] is true if tuple i can be null More... | |
std::vector< int > | tuple_idx_map_ |
map from TupleId to position of tuple w/in row More... | |
Records positions of tuples within row produced by ExecNode. TODO: this needs to differentiate between tuples contained in row and tuples produced by ExecNode (parallel to PlanNode.rowTupleIds and PlanNode.tupleIds); right now, we conflate the two (and distinguish based on context; for instance, HdfsScanNode uses these tids to create row batches, ie, the first case, whereas TopNNode uses these tids to copy output rows, ie, the second case)
Definition at line 373 of file descriptors.h.
impala::RowDescriptor::RowDescriptor | ( | const DescriptorTbl & | desc_tbl, |
const std::vector< TTupleId > & | row_tuples, | ||
const std::vector< bool > & | nullable_tuples | ||
) |
|
inline |
standard copy c'tor, made explicit here
Definition at line 379 of file descriptors.h.
impala::RowDescriptor::RowDescriptor | ( | const RowDescriptor & | lhs_row_desc, |
const RowDescriptor & | rhs_row_desc | ||
) |
c'tor for a row assembled from two rows
Definition at line 278 of file descriptors.cc.
References InitTupleIdxMap(), tuple_desc_map_, and tuple_idx_nullable_map_.
impala::RowDescriptor::RowDescriptor | ( | const std::vector< TupleDescriptor * > & | tuple_descs, |
const std::vector< bool > & | nullable_tuples | ||
) |
impala::RowDescriptor::RowDescriptor | ( | TupleDescriptor * | tuple_desc, |
bool | is_nullable | ||
) |
Definition at line 301 of file descriptors.cc.
References InitTupleIdxMap().
|
inline |
dummy descriptor, needed for the JNI EvalPredicate() function
Definition at line 393 of file descriptors.h.
string impala::RowDescriptor::DebugString | ( | ) | const |
Definition at line 370 of file descriptors.cc.
References tuple_desc_map_.
Referenced by GetTupleIdx(), and impala::SlotRef::Prepare().
bool impala::RowDescriptor::Equals | ( | const RowDescriptor & | other_desc | ) | const |
Return true if the tuple ids of this descriptor match tuple ids of other desc.
Definition at line 361 of file descriptors.cc.
References tuple_desc_map_.
Referenced by impala::RowBatch::AcquireState(), and impala::BufferedTupleStream::GetNextInternal().
int impala::RowDescriptor::GetRowSize | ( | ) | const |
Returns total size in bytes. TODO: also take avg string lengths into account, ie, change this to GetAvgRowSize()
Definition at line 320 of file descriptors.cc.
References tuple_desc_map_.
Referenced by impala::DataStreamSender::Channel::Init(), and impala::RowBatch::MaxTupleBufferSize().
int impala::RowDescriptor::GetTupleIdx | ( | TupleId | id | ) | const |
Returns INVALID_IDX if id not part of this row.
Definition at line 328 of file descriptors.cc.
References DebugString(), and tuple_idx_map_.
Referenced by impala::SlotRef::Prepare(), and impala::TupleIsNullPredicate::Prepare().
|
private |
Initializes tupleIdxMap during c'tor using the tuple_desc_map_.
Definition at line 307 of file descriptors.cc.
References INVALID_IDX, tuple_desc_map_, and tuple_idx_map_.
Referenced by RowDescriptor().
bool impala::RowDescriptor::IsAnyTupleNullable | ( | ) | const |
Return true if any Tuple of the row is nullable.
Definition at line 338 of file descriptors.cc.
References tuple_idx_nullable_map_.
bool impala::RowDescriptor::IsPrefixOf | ( | const RowDescriptor & | other_desc | ) | const |
Return true if the tuple ids of this descriptor are a prefix of the tuple ids of other_desc.
Definition at line 352 of file descriptors.cc.
References tuple_desc_map_.
Referenced by impala::ExchangeNode::GetNext().
void impala::RowDescriptor::ToThrift | ( | std::vector< TTupleId > * | row_tuple_ids | ) |
Populate row_tuple_ids with our ids.
Definition at line 345 of file descriptors.cc.
References tuple_desc_map_.
Referenced by impala::RowBatch::Serialize().
|
inline |
Return descriptors for all tuples in this row, in order of appearance.
Definition at line 412 of file descriptors.h.
References tuple_desc_map_.
Referenced by impala::Sorter::Run::AddBatch(), impala::Sorter::AddBatch(), impala::DataStreamSender::Channel::AddRow(), impala::SimpleTupleStreamTest::AppendRowTuples(), impala::BufferedTupleStream::BufferedTupleStream(), impala::HashJoinNode::CodegenCreateOutputRow(), impala::PartitionedHashJoinNode::CodegenCreateOutputRow(), impala::BufferedTupleStream::ComputeNumNullIndicatorBytes(), impala::SimpleTupleStreamTest::CreateIntBatch(), impala::SimpleTupleStreamTest::CreateStringBatch(), impala::BufferedTupleStream::DeepCopyInternal(), impala::Sorter::EstimateMergeMem(), impala::BlockingJoinNode::GetLeftChildRowString(), impala::SortedRunMerger::GetNext(), impala::BufferedTupleStream::GetNextInternal(), impala::AnalyticEvalNode::GetNextOutputBatch(), impala::BufferedTupleStream::GetTupleRow(), impala::Sorter::Init(), impala::Sorter::MergeIntermediateRuns(), impala::TopNNode::Prepare(), impala::BlockingJoinNode::Prepare(), impala::AnalyticEvalNode::Prepare(), impala::PartitionedHashJoinNode::Prepare(), impala::PrintRow(), impala::RowBatch::RowBatch(), impala::RowEqualityChecker::RowEqualityChecker(), impala::RowBatch::Serialize(), impala::SimpleTupleStreamTest::TestIntValuesInterleaved(), impala::RowBatch::TotalByteSize(), and impala::SimpleTupleStreamTest::VerifyResults().
bool impala::RowDescriptor::TupleIsNullable | ( | int | tuple_idx | ) | const |
Return true if the Tuple of the given Tuple index is nullable.
Definition at line 333 of file descriptors.cc.
References tuple_idx_nullable_map_.
Referenced by impala::SlotRef::Prepare(), and impala::TupleIsNullPredicate::Prepare().
|
static |
Definition at line 400 of file descriptors.h.
Referenced by InitTupleIdxMap(), impala::SlotRef::Prepare(), and impala::TupleIsNullPredicate::Prepare().
|
private |
map from position of tuple w/in row to its descriptor
Definition at line 433 of file descriptors.h.
Referenced by DebugString(), Equals(), GetRowSize(), InitTupleIdxMap(), IsPrefixOf(), RowDescriptor(), ToThrift(), and tuple_descriptors().
|
private |
map from TupleId to position of tuple w/in row
Definition at line 439 of file descriptors.h.
Referenced by GetTupleIdx(), and InitTupleIdxMap().
|
private |
tuple_idx_nullable_map_[i] is true if tuple i can be null
Definition at line 436 of file descriptors.h.
Referenced by IsAnyTupleNullable(), RowDescriptor(), and TupleIsNullable().