Fix some hash distinct bug for vec2.0

This commit is contained in:
obdev
2024-01-09 10:43:13 +00:00
committed by ob-robot
parent acac044c59
commit 3f61aea79d
4 changed files with 11 additions and 7 deletions

View File

@ -557,9 +557,14 @@ int ObExtendHashTableVec<GroupRowBucket>::set_distinct_batch(const RowMeta &row_
{
int ret = OB_SUCCESS;
new_row_selector_cnt_ = 0;
if (auto_extend_ && OB_UNLIKELY((size_ + batch_size) * SIZE_BUCKET_SCALE >= get_bucket_num())) {
while (OB_SUCC(ret) && auto_extend_ && OB_UNLIKELY((size_ + batch_size)
* SIZE_BUCKET_SCALE >= get_bucket_num())) {
int64_t pre_bkt_num = get_bucket_num();
if (OB_FAIL(extend())) {
SQL_ENG_LOG(WARN, "extend failed", K(ret));
} else if (get_bucket_num() <= pre_bkt_num) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("failed to extend table", K(ret), K(pre_bkt_num), K(get_bucket_num()));
}
}
if (OB_SUCC(ret) && OB_ISNULL(locate_buckets_)) {