Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
cross-join-node.h
Go to the documentation of this file.
1 // Copyright 2013 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_CROSS_JOIN_NODE_H
17 #define IMPALA_EXEC_CROSS_JOIN_NODE_H
18 
19 #include <boost/scoped_ptr.hpp>
20 #include <boost/unordered_set.hpp>
21 #include <boost/thread.hpp>
22 #include <string>
23 
24 #include "exec/exec-node.h"
26 #include "exec/row-batch-list.h"
27 #include "runtime/descriptors.h" // for TupleDescriptor
28 #include "runtime/mem-pool.h"
29 #include "util/promise.h"
30 
31 #include "gen-cpp/PlanNodes_types.h"
32 
33 namespace impala {
34 
35 class RowBatch;
36 class TupleRow;
37 
45  public:
46  CrossJoinNode(ObjectPool* pool, const TPlanNode& tnode, const DescriptorTbl& descs);
47 
48  virtual Status Prepare(RuntimeState* state);
49  virtual Status GetNext(RuntimeState* state, RowBatch* row_batch, bool* eos);
50  virtual Status Reset(RuntimeState* state);
51  virtual void Close(RuntimeState* state);
52 
53  protected:
54  virtual Status InitGetNext(TupleRow* first_left_row);
55  virtual Status ConstructBuildSide(RuntimeState* state);
56 
57  private:
59  boost::scoped_ptr<ObjectPool> build_batch_pool_;
63 
70  int ProcessLeftChildBatch(RowBatch* output_batch, RowBatch* batch, int max_added_rows);
71 
74  std::string BuildListDebugString();
75 };
76 
77 }
78 
79 #endif
virtual Status GetNext(RuntimeState *state, RowBatch *row_batch, bool *eos)
boost::scoped_ptr< ObjectPool > build_batch_pool_
Object pool for build RowBatches, stores all BuildBatches in build_rows_.
A simple iterator used to scan over all the rows stored in the list.
CrossJoinNode(ObjectPool *pool, const TPlanNode &tnode, const DescriptorTbl &descs)
virtual Status Prepare(RuntimeState *state)
virtual Status Reset(RuntimeState *state)
std::string BuildListDebugString()
RowBatchList build_batches_
List of build batches, constructed in Prepare()
ObjectPool pool
int ProcessLeftChildBatch(RowBatch *output_batch, RowBatch *batch, int max_added_rows)
virtual Status InitGetNext(TupleRow *first_left_row)
RowBatchList::TupleRowIterator current_build_row_
virtual void Close(RuntimeState *state)
virtual Status ConstructBuildSide(RuntimeState *state)