15 #ifndef IMPALA_EXEC_ANALYTIC_EVAL_NODE_H
16 #define IMPALA_EXEC_ANALYTIC_EVAL_NODE_H
73 virtual void DebugString(
int indentation_level, std::stringstream* out)
const;
236 std::vector<impala_udf::FunctionContext*>
fn_ctxs_;
void TryAddRemainingResults(int64_t partition_idx, int64_t prev_partition_idx)
std::string DebugStateString(bool detailed) const
Debug string containing current state. If 'detailed', per-row state is included.
std::vector< bool > is_lead_fn_
void TryAddResultTupleForPrevRow(bool next_partition, int64_t stream_idx, TupleRow *row)
virtual Status QueryMaintenance(RuntimeState *state)
Frees local allocations from evaluators_.
virtual Status Init(const TPlanNode &tnode)
Status GetNextOutputBatch(RuntimeState *state, RowBatch *row_batch, bool *eos)
TupleRow * child_tuple_cmp_row_
bool input_eos_
True when there are no more input rows to consume from our child.
long first_val_null_offset_
boost::scoped_ptr< RowBatch > curr_child_batch_
A tuple with 0 materialised slots is represented as NULL.
virtual Status Reset(RuntimeState *state)
const TAnalyticWindow window_
std::string DebugWindowString() const
Debug string containing the window definition.
int64_t NumOutputRowsReady() const
int64_t prev_pool_last_window_idx_
virtual void Close(RuntimeState *state)
TupleRow * prev_input_row_
void TryRemoveRowsBeforeWindow(int64_t stream_idx)
std::string DebugString() const
Returns a string representation in DFS order of the plan rooted at this.
AnalyticFnScope fn_scope_
void InitNextPartition(int64_t stream_idx)
boost::scoped_ptr< MemPool > mem_pool_
Pool used for O(1) allocations that live until close.
TupleDescriptor * child_tuple_desc_
int64_t prev_pool_last_result_idx_
Status ProcessChildBatches(RuntimeState *state)
bool PrevRowCompare(ExprContext *pred_ctx)
int64_t rows_start_offset_
BufferedBlockMgr::Client * client_
Block manager client used by input_stream_. Not owned.
const TupleDescriptor * intermediate_tuple_desc_
Tuple descriptor for storing intermediate values of analytic fn evaluation.
std::vector< AggFnEvaluator * > evaluators_
Analytic function evaluators.
std::list< std::pair< int64_t, Tuple * > > result_tuples_
RuntimeProfile::Counter * evaluation_timer_
Time spent processing the child rows.
Status ProcessChildBatch(RuntimeState *state)
bool has_first_val_null_offset_
Tuple * dummy_result_tuple_
ExprContext * partition_by_eq_expr_ctx_
boost::scoped_ptr< BufferedTupleStream > input_stream_
std::string DebugEvaluatedRowsString() const
int64_t last_result_idx_
Index in input_stream_ of the most recently added result tuple.
TupleDescriptor * buffered_tuple_desc_
int64_t curr_partition_idx_
Index of the row in input_stream_ at which the current partition started.
boost::scoped_ptr< RowBatch > prev_child_batch_
ExprContext * order_by_eq_expr_ctx_
std::vector< impala_udf::FunctionContext * > fn_ctxs_
boost::scoped_ptr< MemPool > curr_tuple_pool_
void AddResultTuple(int64_t stream_idx)
boost::scoped_ptr< MemPool > prev_tuple_pool_
Status AddRow(int64_t stream_idx, TupleRow *row)
Adds the row to the evaluators and the tuple stream.
void TryAddResultTupleForCurrRow(int64_t stream_idx, TupleRow *row)
std::list< std::pair< int64_t, Tuple * > > window_tuples_
virtual Status Open(RuntimeState *state)
AnalyticEvalNode(ObjectPool *pool, const TPlanNode &tnode, const DescriptorTbl &descs)
virtual Status Prepare(RuntimeState *state)
virtual Status GetNext(RuntimeState *state, RowBatch *row_batch, bool *eos)
const TupleDescriptor * result_tuple_desc_
Tuple descriptor for storing results of analytic fn evaluation.