27 offset_(tnode.sort_node.__isset.
offset ? tnode.sort_node.
offset : 0),
28 num_rows_skipped_(0) {
97 if (rows_to_keep > 0) {
103 if (rows_to_keep > 0 || *eos)
break;
119 DCHECK(
false) <<
"NYI";
131 *out << string(indentation_level * 2,
' ');
135 *out << (i > 0 ?
" " :
"")
boost::scoped_ptr< Sorter > sorter_
Object used for external sorting.
int64_t num_rows_skipped_
int64_t num_rows_returned_
virtual Status Prepare(RuntimeState *state)
MemTracker * mem_tracker()
boost::scoped_ptr< RuntimeProfile > runtime_profile_
#define RETURN_IF_ERROR(stmt)
some generally useful macros
virtual Status Init(const TPlanNode &tnode)
RowDescriptor row_descriptor_
virtual Status Open(RuntimeState *state)
void CopyRows(int dest, int src, int num_rows)
const RowDescriptor & row_desc() const
virtual Status Reset(RuntimeState *state)
std::vector< bool > is_asc_order_
Status ExecDebugAction(TExecNodePhase::type phase, RuntimeState *state)
Status Open(RuntimeState *state)
Open all expressions used for sorting and tuple materialization.
virtual Status Init(const TPlanNode &tnode)
std::string DebugString() const
Returns a string representation in DFS order of the plan rooted at this.
MemTracker * expr_mem_tracker()
Status SortInput(RuntimeState *state)
Fetch input rows and feed them to the sorter until the input is exhausted.
void Reset()
Resets the row batch, returning all resources it has accumulated.
void set_num_rows(int num_rows)
virtual void Close(RuntimeState *state)
#define RETURN_IF_CANCELLED(state)
Status Init(const TSortInfo &sort_info, ObjectPool *pool)
Initialize the expressions from a TSortInfo using the specified pool.
virtual Status Prepare(RuntimeState *state)
const std::vector< ExprContext * > & lhs_ordering_expr_ctxs() const
Can only be used after calling Prepare()
void AddExprCtxsToFree(const std::vector< ExprContext * > &ctxs)
virtual Status QueryMaintenance(RuntimeState *state)
#define COUNTER_SET(c, v)
RuntimeProfile::Counter * rows_returned_counter_
int64_t offset_
Number of rows to skip.
SortExecExprs sort_exec_exprs_
Expressions and parameters used for tuple materialization and tuple comparison.
SortNode(ObjectPool *pool, const TPlanNode &tnode, const DescriptorTbl &descs)
Note that Init() must be called right after the constructor.
uint8_t offset[7 *64-sizeof(uint64_t)]
virtual Status GetNext(RuntimeState *state, RowBatch *row_batch, bool *eos)
Status Prepare(RuntimeState *state, const RowDescriptor &child_row_desc, const RowDescriptor &output_row_desc, MemTracker *expr_mem_tracker)
Prepare all expressions used for sorting and tuple materialization.
virtual Status Open(RuntimeState *state)
std::vector< bool > nulls_first_
virtual void Close(RuntimeState *state)
virtual std::string DebugString() const
void Close(RuntimeState *state)
Close all expressions used for sorting and tuple materialization.
const std::vector< ExprContext * > & sort_tuple_slot_expr_ctxs() const
const std::vector< ExprContext * > & rhs_ordering_expr_ctxs() const
Can only be used after calling Open()
RuntimeProfile * runtime_profile()