Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
sort-exec-exprs.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_EXEC_SORT_EXEC_EXPRS_H
16 #define IMPALA_EXEC_SORT_EXEC_EXPRS_H
17 
18 #include "exprs/expr.h"
19 #include "runtime/runtime-state.h"
20 
21 namespace impala {
22 
30  public:
32  Status Init(const TSortInfo& sort_info, ObjectPool* pool);
33 
37  Status Init(const std::vector<TExpr>& ordering_exprs,
38  const std::vector<TExpr>* sort_tuple_slot_exprs, ObjectPool* pool);
39 
41  Status Prepare(RuntimeState* state, const RowDescriptor& child_row_desc,
42  const RowDescriptor& output_row_desc, MemTracker* expr_mem_tracker);
43 
45  Status Open(RuntimeState* state);
46 
48  void Close(RuntimeState* state);
49 
50  const std::vector<ExprContext*>& sort_tuple_slot_expr_ctxs() const {
52  }
53 
55  const std::vector<ExprContext*>& lhs_ordering_expr_ctxs() const {
57  }
59  const std::vector<ExprContext*>& rhs_ordering_expr_ctxs() const {
61  }
62 
63  private:
65  std::vector<ExprContext*> lhs_ordering_expr_ctxs_;
66  std::vector<ExprContext*> rhs_ordering_expr_ctxs_;
67 
71 
75  std::vector<ExprContext*> sort_tuple_slot_expr_ctxs_;
76 };
77 
78 }
79 
80 #endif
Status Open(RuntimeState *state)
Open all expressions used for sorting and tuple materialization.
std::vector< ExprContext * > sort_tuple_slot_expr_ctxs_
std::vector< ExprContext * > rhs_ordering_expr_ctxs_
ObjectPool pool
Status Init(const TSortInfo &sort_info, ObjectPool *pool)
Initialize the expressions from a TSortInfo using the specified pool.
const std::vector< ExprContext * > & lhs_ordering_expr_ctxs() const
Can only be used after calling Prepare()
This class is thread-safe.
Definition: mem-tracker.h:61
std::vector< ExprContext * > lhs_ordering_expr_ctxs_
Create two ExprContexts for evaluating over the TupleRows.
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.
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()