25 #include "gen-cpp/PlanNodes_types.h"
29 using namespace impala;
37 node_name_(node_name),
40 probe_side_eos_(false),
41 semi_join_staging_row_(NULL),
42 can_add_probe_filters_(false) {
72 case TJoinOp::LEFT_ANTI_JOIN:
73 case TJoinOp::LEFT_SEMI_JOIN:
74 case TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN: {
79 case TJoinOp::RIGHT_ANTI_JOIN:
80 case TJoinOp::RIGHT_SEMI_JOIN: {
92 for (
int i = 0; i < num_left_tuples; ++i) {
94 DCHECK_EQ(i,
row_desc().GetTupleIdx(desc->
id()));
96 for (
int i = 0; i < num_build_tuples; ++i) {
98 DCHECK_EQ(num_left_tuples + i,
row_desc().GetTupleIdx(desc->
id()));
108 if (
join_op_ == TJoinOp::LEFT_ANTI_JOIN ||
join_op_ == TJoinOp::LEFT_SEMI_JOIN ||
109 join_op_ == TJoinOp::RIGHT_ANTI_JOIN ||
join_op_ == TJoinOp::RIGHT_SEMI_JOIN ||
110 join_op_ == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN) {
170 if (!state->
cgroup().empty()) {
172 build_thread, state->
cgroup());
213 *out << string(indentation_level * 2,
' ');
215 *out <<
"(eos=" << (
eos_ ?
"true" :
"false")
227 if (i != 0) out <<
" ";
228 if (i >= num_probe_tuple_rows) {
241 uint8_t* out_ptr =
reinterpret_cast<uint8_t*
>(out);
void AddRuntimeExecOption(const std::string &option)
Appends option to 'runtime_exec_options_'.
Tuple * GetTuple(int tuple_idx)
virtual void AddToDebugString(int indentation_level, std::stringstream *out) const
MemTracker * mem_tracker()
TODO: Consider allowing fragment IDs as category parameters.
bool TryAcquireThreadToken(bool *is_reserved=NULL)
void CreateOutputRow(TupleRow *out_row, TupleRow *probe_row, TupleRow *build_row)
boost::scoped_ptr< RuntimeProfile > runtime_profile_
A tuple with 0 materialised slots is represented as NULL.
virtual Status Prepare(RuntimeState *state)
TupleRow * current_probe_row_
BlockingJoinNode(const std::string &node_name, const TJoinOp::type join_op, ObjectPool *pool, const TPlanNode &tnode, const DescriptorTbl &descs)
#define RETURN_IF_ERROR(stmt)
some generally useful macros
virtual Status Init(const TPlanNode &tnode)
int probe_tuple_row_size_
#define ADD_TIMER(profile, name)
virtual void Close(RuntimeState *state)
virtual Status Init(const TPlanNode &tnode)
RuntimeProfile::Counter * build_timer_
const std::string & cgroup() const
const RowDescriptor & row_desc() const
void ReleaseThreadToken(bool required)
#define COUNTER_ADD(c, v)
void BuildSideThread(RuntimeState *state, Promise< Status > *status)
RuntimeProfile::Counter * probe_timer_
boost::scoped_ptr< MemPool > build_pool_
CgroupsMgr * cgroups_mgr()
std::string DebugString() const
Returns a string representation in DFS order of the plan rooted at this.
RuntimeProfile::Counter * probe_row_counter_
bool LogError(const ErrorMsg &msg)
#define RETURN_IF_CANCELLED(state)
Status AssignThreadToCgroup(const Thread &thread, const std::string &cgroup) const
virtual Status Prepare(RuntimeState *state)
#define ADD_COUNTER(profile, name, unit)
virtual Status ConstructBuildSide(RuntimeState *state)=0
virtual Status Reset(RuntimeState *state)
virtual Status QueryMaintenance(RuntimeState *state)
int build_tuple_row_size_
virtual Status Open(RuntimeState *state)
const std::string node_name_
virtual ~BlockingJoinNode()
const std::vector< TupleDescriptor * > & tuple_descriptors() const
Return descriptors for all tuples in this row, in order of appearance.
std::string GetLeftChildRowString(TupleRow *row)
static const char * LLVM_CLASS_NAME
RuntimeProfile::Counter * build_row_counter_
const ErrorMsg & msg() const
Returns the error message associated with a non-successful status.
virtual Status Open(RuntimeState *state)
boost::scoped_ptr< RowBatch > probe_batch_
string PrintTuple(const Tuple *t, const TupleDescriptor &d)
virtual Status InitGetNext(TupleRow *first_left_child_row)=0
ThreadResourceMgr::ResourcePool * resource_pool()
TupleRow * semi_join_staging_row_
virtual void Close(RuntimeState *state)
RuntimeProfile::Counter * total_cpu_timer()
virtual Status GetNext(RuntimeState *state, RowBatch *row_batch, bool *eos)=0
virtual Status Reset(RuntimeState *state)
RuntimeProfile * runtime_profile()