16 #ifndef IMPALA_EXEC_TOPN_NODE_H
17 #define IMPALA_EXEC_TOPN_NODE_H
20 #include <boost/scoped_ptr.hpp>
50 virtual void DebugString(
int indentation_level, std::stringstream* out)
const;
std::vector< bool > is_asc_order_
void InsertTupleRow(TupleRow *tuple_row)
virtual Status Reset(RuntimeState *state)
A tuple with 0 materialised slots is represented as NULL.
boost::scoped_ptr< TupleRowComparator > tuple_row_less_than_
std::vector< bool > nulls_first_
boost::scoped_ptr< MemPool > tuple_pool_
Stores everything referenced in priority_queue_.
virtual Status Prepare(RuntimeState *state)
std::string DebugString() const
Returns a string representation in DFS order of the plan rooted at this.
std::vector< Tuple * >::iterator get_next_iter_
virtual Status Init(const TPlanNode &tnode)
virtual void Close(RuntimeState *state)
virtual Status GetNext(RuntimeState *state, RowBatch *row_batch, bool *eos)
TopNNode(ObjectPool *pool, const TPlanNode &tnode, const DescriptorTbl &descs)
int64_t offset_
Number of rows to skip.
std::vector< Tuple * > sorted_top_n_
After computing the TopN in the priority_queue, pop them and put them in this vector.
TupleDescriptor * materialized_tuple_desc_
Cached descriptor for the materialized tuple. Assigned in Prepare().
friend class TupleLessThan
SortExecExprs sort_exec_exprs_
virtual Status Open(RuntimeState *state)
void PrepareForOutput()
Flatten and reverse the priority queue.
boost::scoped_ptr< std::priority_queue< Tuple *, std::vector< Tuple * >, TupleRowComparator > > priority_queue_
int64_t num_rows_skipped_