Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
impala::SlotDescriptor Class Reference

#include <descriptors.h>

Collaboration diagram for impala::SlotDescriptor:

Public Member Functions

SlotId id () const
 
const ColumnTypetype () const
 
TupleId parent () const
 
int col_pos () const
 
const std::vector< int > & col_path () const
 
int field_idx () const
 Returns the field index in the generated llvm struct for this slot's tuple. More...
 
int tuple_offset () const
 
const NullIndicatorOffsetnull_indicator_offset () const
 
bool is_materialized () const
 
bool is_nullable () const
 
int slot_size () const
 
std::string DebugString () const
 
llvm::Function * CodegenIsNull (LlvmCodeGen *, llvm::StructType *tuple)
 
llvm::Function * CodegenUpdateNull (LlvmCodeGen *, llvm::StructType *tuple, bool set_null)
 

Static Public Member Functions

static bool ColPathLessThan (const SlotDescriptor *a, const SlotDescriptor *b)
 

Private Member Functions

 SlotDescriptor (const TSlotDescriptor &tdesc)
 

Private Attributes

const SlotId id_
 
const ColumnType type_
 
const TupleId parent_
 
const std::vector< int > col_path_
 
const int tuple_offset_
 
const NullIndicatorOffset null_indicator_offset_
 
const int slot_idx_
 
const int slot_size_
 the byte size of this slot. More...
 
int field_idx_
 
const bool is_materialized_
 
llvm::Function * is_null_fn_
 Cached codegen'd functions. More...
 
llvm::Function * set_not_null_fn_
 
llvm::Function * set_null_fn_
 

Friends

class DescriptorTbl
 
class TupleDescriptor
 

Detailed Description

Definition at line 75 of file descriptors.h.

Constructor & Destructor Documentation

impala::SlotDescriptor::SlotDescriptor ( const TSlotDescriptor &  tdesc)
private

Definition at line 50 of file descriptors.cc.

Member Function Documentation

const std::vector<int>& impala::SlotDescriptor::col_path ( ) const
inline
int impala::SlotDescriptor::col_pos ( ) const
inline

Returns the column index of this slot, including partition keys. (e.g., col_pos - num_partition_keys = the table column this slot corresponds to) TODO: This function should eventually be replaced by col_path(). It is currently convenient for table formats for which we only support flat data.

Definition at line 84 of file descriptors.h.

References col_path_.

Referenced by impala::HdfsScanNode::InitTemplateTuple(), impala::DataSourceScanNode::Open(), impala::HdfsRCFileScanner::ProcessRange(), impala::HdfsScanner::ReportColumnParseError(), impala::HdfsAvroScanner::ResolveSchemas(), and impala::HdfsAvroScanner::VerifyTypesMatch().

bool impala::SlotDescriptor::ColPathLessThan ( const SlotDescriptor a,
const SlotDescriptor b 
)
static

Comparison function for ordering slot descriptors by their col_path_. Returns true if 'a' comes before 'b'. Orders the paths as in a depth-first traversal of the schema tree, as follows:

  • for each level i in min(a.path.size, b.path.size), order the paths ascending by col_path_[i]
  • in case of ties, the path with smaller size comes first

Definition at line 66 of file descriptors.cc.

References col_path().

Referenced by impala::HBaseScanNode::Prepare(), and impala::HdfsScanNode::Prepare().

string impala::SlotDescriptor::DebugString ( ) const
SlotId impala::SlotDescriptor::id ( ) const
inline

Definition at line 77 of file descriptors.h.

References id_.

TupleId impala::SlotDescriptor::parent ( ) const
inline

Definition at line 79 of file descriptors.h.

References parent_.

Referenced by impala::SlotRef::Prepare().

int impala::SlotDescriptor::slot_size ( ) const
inline

Definition at line 94 of file descriptors.h.

References slot_size_.

Referenced by impala::TextConverter::WriteSlot().

Friends And Related Function Documentation

friend class DescriptorTbl
friend

Definition at line 115 of file descriptors.h.

friend class TupleDescriptor
friend

Definition at line 116 of file descriptors.h.

Member Data Documentation

const std::vector<int> impala::SlotDescriptor::col_path_
private

Definition at line 121 of file descriptors.h.

Referenced by col_path(), col_pos(), and DebugString().

int impala::SlotDescriptor::field_idx_
private

the idx of the slot in the llvm codegen'd tuple struct this is set by TupleDescriptor during codegen and takes into account leading null bytes.

Definition at line 135 of file descriptors.h.

Referenced by DebugString(), field_idx(), and impala::TupleDescriptor::GenerateLlvmStruct().

const SlotId impala::SlotDescriptor::id_
private

Definition at line 118 of file descriptors.h.

Referenced by DebugString(), and id().

const bool impala::SlotDescriptor::is_materialized_
private

Definition at line 137 of file descriptors.h.

Referenced by is_materialized().

llvm::Function* impala::SlotDescriptor::is_null_fn_
private

Cached codegen'd functions.

Definition at line 140 of file descriptors.h.

Referenced by CodegenIsNull().

const NullIndicatorOffset impala::SlotDescriptor::null_indicator_offset_
private
const TupleId impala::SlotDescriptor::parent_
private

Definition at line 120 of file descriptors.h.

Referenced by parent().

llvm::Function* impala::SlotDescriptor::set_not_null_fn_
private

Definition at line 141 of file descriptors.h.

Referenced by CodegenUpdateNull().

llvm::Function* impala::SlotDescriptor::set_null_fn_
private

Definition at line 142 of file descriptors.h.

Referenced by CodegenUpdateNull().

const int impala::SlotDescriptor::slot_idx_
private

the idx of the slot in the tuple descriptor (0-based). this is provided by the FE

Definition at line 127 of file descriptors.h.

Referenced by DebugString(), and impala::TupleDescriptor::GenerateLlvmStruct().

const int impala::SlotDescriptor::slot_size_
private

the byte size of this slot.

Definition at line 130 of file descriptors.h.

Referenced by slot_size().

const int impala::SlotDescriptor::tuple_offset_
private

Definition at line 122 of file descriptors.h.

Referenced by DebugString(), and tuple_offset().

const ColumnType impala::SlotDescriptor::type_
private

Definition at line 119 of file descriptors.h.

Referenced by DebugString(), and type().


The documentation for this class was generated from the following files: