Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
select-node.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 
16 #ifndef IMPALA_EXEC_SELECT_NODE_H
17 #define IMPALA_EXEC_SELECT_NODE_H
18 
19 #include <boost/scoped_ptr.hpp>
20 
21 #include "exec/exec-node.h"
22 #include "runtime/mem-pool.h"
23 #include <boost/scoped_ptr.hpp>
24 
25 namespace impala {
26 
27 class Tuple;
28 class TupleRow;
29 
32 class SelectNode : public ExecNode {
33  public:
34  SelectNode(ObjectPool* pool, const TPlanNode& tnode, const DescriptorTbl& descs);
35 
36  virtual Status Prepare(RuntimeState* state);
37  virtual Status Open(RuntimeState* state);
38  virtual Status GetNext(RuntimeState* state, RowBatch* row_batch, bool* eos);
39  virtual Status Reset(RuntimeState* state);
40  virtual void Close(RuntimeState* state);
41 
42  private:
44  boost::scoped_ptr<RowBatch> child_row_batch_;
45 
48 
50  bool child_eos_;
51 
55  bool CopyRows(RowBatch* output_batch);
56 };
57 
58 }
59 
60 #endif
bool CopyRows(RowBatch *output_batch)
Definition: select-node.cc:88
boost::scoped_ptr< RowBatch > child_row_batch_
current row batch of child
Definition: select-node.h:44
bool child_eos_
true if last GetNext() call on child signalled eos
Definition: select-node.h:50
int child_row_idx_
index of current row in child_row_batch_
Definition: select-node.h:47
SelectNode(ObjectPool *pool, const TPlanNode &tnode, const DescriptorTbl &descs)
Definition: select-node.cc:26
virtual Status Reset(RuntimeState *state)
Definition: select-node.cc:110
ObjectPool pool
virtual Status GetNext(RuntimeState *state, RowBatch *row_batch, bool *eos)
Definition: select-node.cc:49
virtual Status Prepare(RuntimeState *state)
Definition: select-node.cc:34
virtual void Close(RuntimeState *state)
Definition: select-node.cc:115
virtual Status Open(RuntimeState *state)
Definition: select-node.cc:42