Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
slot-ref.h
Go to the documentation of this file.
1 // Copyright 2012 Cloudera Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef IMPALA_EXPRS_SLOTREF_H
16 #define IMPALA_EXPRS_SLOTREF_H
17 
18 #include "exprs/expr.h"
19 
20 namespace impala {
21 
23 class SlotRef : public Expr {
24  public:
25  SlotRef(const TExprNode& node);
26  SlotRef(const SlotDescriptor* desc);
27 
30  SlotRef(const SlotDescriptor* desc, const ColumnType& type);
31 
33  SlotRef(const ColumnType& type, int offset);
34 
35  virtual Status Prepare(RuntimeState* state, const RowDescriptor& row_desc,
36  ExprContext* context);
37  virtual std::string DebugString() const;
38  virtual bool IsConstant() const { return false; }
39  virtual int GetSlotIds(std::vector<SlotId>* slot_ids) const;
40  const SlotId& slot_id() const { return slot_id_; }
41 
42  virtual Status GetCodegendComputeFn(RuntimeState* state, llvm::Function** fn);
43 
54 
55  protected:
56  int tuple_idx_; // within row
57  int slot_offset_; // within tuple
60  bool tuple_is_nullable_; // true if the tuple is nullable.
61 };
62 
63 }
64 
65 #endif
int slot_offset_
Definition: slot-ref.h:57
virtual impala_udf::BooleanVal GetBooleanVal(ExprContext *context, TupleRow *)
Definition: slot-ref.cc:371
virtual impala_udf::SmallIntVal GetSmallIntVal(ExprContext *context, TupleRow *)
Definition: slot-ref.cc:385
virtual Status GetCodegendComputeFn(RuntimeState *state, llvm::Function **fn)
Definition: slot-ref.cc:155
virtual impala_udf::TimestampVal GetTimestampVal(ExprContext *context, TupleRow *)
Definition: slot-ref.cc:436
virtual impala_udf::IntVal GetIntVal(ExprContext *context, TupleRow *)
Definition: slot-ref.cc:392
virtual impala_udf::FloatVal GetFloatVal(ExprContext *context, TupleRow *)
Definition: slot-ref.cc:406
virtual impala_udf::TinyIntVal GetTinyIntVal(ExprContext *context, TupleRow *)
Definition: slot-ref.cc:378
This object has a compatible storage format with boost::ptime.
Definition: udf.h:495
virtual impala_udf::StringVal GetStringVal(ExprContext *context, TupleRow *)
Definition: slot-ref.cc:420
virtual impala_udf::DoubleVal GetDoubleVal(ExprContext *context, TupleRow *)
Definition: slot-ref.cc:413
NullIndicatorOffset null_indicator_offset_
Definition: slot-ref.h:58
int SlotId
Definition: global-types.h:24
This is the superclass of all expr evaluation nodes.
Definition: expr.h:116
SlotRef(const TExprNode &node)
Definition: slot-ref.cc:31
const SlotId & slot_id() const
Definition: slot-ref.h:40
const RowDescriptor & row_desc() const
const ColumnType & type() const
Definition: expr.h:145
Reference to a single slot of a tuple.
Definition: slot-ref.h:23
const SlotId slot_id_
Definition: slot-ref.h:59
virtual int GetSlotIds(std::vector< SlotId > *slot_ids) const
Definition: slot-ref.cc:99
virtual impala_udf::BigIntVal GetBigIntVal(ExprContext *context, TupleRow *)
Definition: slot-ref.cc:399
uint8_t offset[7 *64-sizeof(uint64_t)]
virtual Status Prepare(RuntimeState *state, const RowDescriptor &row_desc, ExprContext *context)
Definition: slot-ref.cc:63
virtual impala_udf::DecimalVal GetDecimalVal(ExprContext *context, TupleRow *)
Definition: slot-ref.cc:446
virtual std::string DebugString() const
Definition: slot-ref.cc:104
bool tuple_is_nullable_
Definition: slot-ref.h:60
virtual bool IsConstant() const
Definition: slot-ref.h:38