26 #include "gen-cpp/PlanNodes_types.h"
30 using namespace impala;
35 :
BlockingJoinNode(
"CrossJoinNode", TJoinOp::CROSS_JOIN, pool, tnode, descs) {
39 DCHECK(
join_op_ == TJoinOp::CROSS_JOIN);
69 DCHECK_EQ(batch->
num_io_buffers(), 0) <<
"Build batch should be compact.";
100 int64_t max_added_rows = output_batch->
capacity() - output_batch->
num_rows();
143 int max_added_rows) {
144 int row_idx = output_batch->
AddRows(max_added_rows);
146 uint8_t* output_row_mem =
reinterpret_cast<uint8_t*
>(output_batch->
GetRow(row_idx));
160 if (
UNLIKELY(rows_returned == max_added_rows))
goto end;
163 output_row =
reinterpret_cast<TupleRow*
>(output_row_mem);
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_.
TupleRowIterator Iterator()
Returns a new iterator over all the tuple rows.
int64_t num_rows_returned_
MemTracker * mem_tracker()
void CreateOutputRow(TupleRow *out_row, TupleRow *probe_row, TupleRow *build_row)
boost::scoped_ptr< RuntimeProfile > runtime_profile_
int num_io_buffers() const
virtual Status Prepare(RuntimeState *state)
void AddRowBatch(RowBatch *row_batch)
TupleRow * current_probe_row_
#define RETURN_IF_ERROR(stmt)
some generally useful macros
TupleRow * GetRow(int row_idx)
CrossJoinNode(ObjectPool *pool, const TPlanNode &tnode, const DescriptorTbl &descs)
virtual void Close(RuntimeState *state)
virtual Status Prepare(RuntimeState *state)
RuntimeProfile::Counter * build_timer_
const RowDescriptor & row_desc() const
#define COUNTER_ADD(c, v)
Status ExecDebugAction(TExecNodePhase::type phase, RuntimeState *state)
virtual Status Reset(RuntimeState *state)
void Reset()
Resets the list.
RuntimeProfile::Counter * probe_timer_
RuntimeProfile::Counter * probe_row_counter_
bool AtEnd()
Returns true if this iterator is at the end, i.e. GetRow() cannot be called.
std::string BuildListDebugString()
#define RETURN_IF_CANCELLED(state)
RowBatchList build_batches_
List of build batches, constructed in Prepare()
int ProcessLeftChildBatch(RowBatch *output_batch, RowBatch *batch, int max_added_rows)
virtual Status Reset(RuntimeState *state)
virtual Status QueryMaintenance(RuntimeState *state)
virtual Status Open(RuntimeState *state)
int64_t rows_returned() const
#define COUNTER_SET(c, v)
RuntimeProfile::Counter * rows_returned_counter_
virtual Status InitGetNext(TupleRow *first_left_row)
std::string DebugString(const RowDescriptor &desc)
Outputs a debug string containing the contents of the list.
RowBatchList::TupleRowIterator current_build_row_
virtual void Close(RuntimeState *state)
virtual Status ConstructBuildSide(RuntimeState *state)
RuntimeProfile::Counter * build_row_counter_
static bool EvalConjuncts(ExprContext *const *ctxs, int num_ctxs, TupleRow *row)
boost::scoped_ptr< RowBatch > probe_batch_
std::vector< ExprContext * > conjunct_ctxs_
void Next()
Increments the iterator. No-op if the iterator is at the end.
static const int INVALID_ROW_INDEX
int64_t total_num_rows()
Returns the total number of rows in all row batches.