76 #ifndef IMPALA_EXPRS_EXPR_H
77 #define IMPALA_EXPRS_EXPR_H
83 #include "impala-ir/impala-ir-functions.h"
94 using namespace impala_udf;
148 const std::vector<Expr*>&
children()
const {
return children_; }
153 virtual bool IsConstant()
const;
157 virtual int GetSlotIds(std::vector<SlotId>* slot_ids)
const;
168 std::vector<ExprContext*>* ctxs);
182 std::vector<ExprContext*>* new_ctxs);
185 static void Close(
const std::vector<ExprContext*>& ctxs,
RuntimeState* state);
204 static int ComputeResultsLayout(
const std::vector<Expr*>& exprs,
205 std::vector<int>* offsets,
int* var_result_begin);
206 static int ComputeResultsLayout(
const std::vector<ExprContext*>& ctxs,
207 std::vector<int>* offsets,
int* var_result_begin);
223 static std::string
DebugString(
const std::vector<Expr*>& exprs);
224 static std::string
DebugString(
const std::vector<ExprContext*>& ctxs);
230 static void InitBuiltinsDummy();
236 friend class CastExpr;
237 friend class ComputeFunctions;
239 friend class DecimalLliteral;
248 friend class FunctionCall;
252 Expr(
const TExprNode& node,
bool is_slotref =
false);
313 llvm::Function* CreateIrFunctionPrototype(
LlvmCodeGen* codegen,
const std::string&
name,
314 llvm::Value* (*args)[2]);
333 std::stringstream out;
358 const std::vector<TExprNode>& nodes,
Expr* parent,
int* node_idx,
llvm::Function * ir_compute_fn_
Cached codegened compute function. Exprs should set this in GetCodegendComputeFn().
const std::vector< Expr * > & children() const
This object has a compatible storage format with boost::ptime.
boost::scoped_ptr< AnyVal > constant_val_
LLVM code generator. This is the top level object to generate jitted code.
void AddChild(Expr *expr)
Conditional functions that can be expressed as UDFs.
static const char * LLVM_CLASS_NAME
std::string DebugString(const T &val)
LibCache::LibCacheEntry * cache_entry_
Cache entry for the library implementing this function.
This is the superclass of all expr evaluation nodes.
This class is thread-safe.
Expr * GetChild(int i) const
const RowDescriptor & row_desc() const
TODO: Reconsider whether this class needs to exist.
std::string DebugString(const std::string &expr_name) const
Simple debug string that provides no expr subclass-specific information.
TFunction fn_
Function description.
const ColumnType & type() const
const ColumnType type_
analysis is done, types are fixed at this point
std::vector< Expr * > children_
const bool is_slotref_
recognize if this node is a slotref in order to speed up GetValue()
Predicate for evaluating expressions of the form "val [NOT] IN (x1, x2, x3...)".
int GetNumChildren() const