fix hash join core when nest loop mode build hash table
This commit is contained in:
@ -314,10 +314,11 @@ public:
|
||||
const ObHJStoredRow **stored_row) {
|
||||
int ret = OB_SUCCESS;
|
||||
if (mem_bound_ < INT64_MAX
|
||||
&& (cur_mem_ > mem_bound_ || cur_row_cnt_ > row_bound_)) {
|
||||
&& (cur_mem_ > mem_bound_ || cur_row_cnt_ >= row_bound_)) {
|
||||
ret = OB_ITER_END;
|
||||
} else {
|
||||
ret = part_->get_next_batch(exprs, ctx, max_rows, read_rows, stored_row);
|
||||
int64_t max_read_rows = min(max_rows, row_bound_ - cur_row_cnt_);
|
||||
ret = part_->get_next_batch(exprs, ctx, max_read_rows, read_rows, stored_row);
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
cur_row_cnt_ += read_rows;
|
||||
@ -333,10 +334,11 @@ public:
|
||||
int64_t &read_rows) {
|
||||
int ret = OB_SUCCESS;
|
||||
if (mem_bound_ < INT64_MAX
|
||||
&& (cur_mem_ > mem_bound_ || cur_row_cnt_ > row_bound_)) {
|
||||
&& (cur_mem_ > mem_bound_ || cur_row_cnt_ >= row_bound_)) {
|
||||
ret = OB_ITER_END;
|
||||
} else {
|
||||
ret = part_->get_next_batch(stored_row, max_rows, read_rows);
|
||||
int64_t max_read_rows = min(max_rows, row_bound_ - cur_row_cnt_);
|
||||
ret = part_->get_next_batch(stored_row, max_read_rows, read_rows);
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
cur_row_cnt_ += read_rows;
|
||||
|
||||
@ -828,7 +828,7 @@ int ObHashJoinVecOp::build_hash_table_for_nest_loop(int64_t &num_left_rows)
|
||||
// at least hold 1 block in memory
|
||||
int64_t memory_bound = std::max(remain_data_memory_size_,
|
||||
hj_part->get_row_store().get_max_blk_size());
|
||||
const int64_t row_bound = hash_table.get_nbuckets() / 2;
|
||||
const int64_t row_bound = min(hash_table.get_row_count(), hash_table.get_nbuckets() / 2);
|
||||
ObTempRowStore::IterationAge iter_age;
|
||||
hj_part->set_iteration_age(iter_age);
|
||||
JoinPartitionRowIter left_iter(hj_part, row_bound, memory_bound);
|
||||
|
||||
Reference in New Issue
Block a user