Fix some hash distinct bug for vec2.0
This commit is contained in:
@ -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_)) {
|
||||
|
||||
@ -1042,7 +1042,7 @@ int ObExtendHashTableVec<GroupRowBucket>::get(const RowMeta &row_meta,
|
||||
if (bucket->is_valid()) {
|
||||
RowItemType *it = &(bucket->get_item());
|
||||
while (OB_SUCC(ret) && nullptr != it) {
|
||||
if (OB_FAIL(likely_equal(row_meta, static_cast<ObCompactRow&>(*it), batch_idx, result))) {
|
||||
if (OB_FAIL(likely_equal_nullable(row_meta, static_cast<ObCompactRow&>(*it), batch_idx, result))) {
|
||||
LOG_WARN("failed to cmp", K(ret));
|
||||
} else if (result) {
|
||||
item = it;
|
||||
|
||||
@ -1286,13 +1286,12 @@ int64_t ObHashPartInfrastructureVecImpl::est_bucket_count(
|
||||
const int64_t min_bucket_cnt,
|
||||
const int64_t max_bucket_cnt)
|
||||
{
|
||||
int64_t est_bucket_cnt = 0;
|
||||
HP_INFRAS_STATUS_CHECK
|
||||
{
|
||||
if (OB_FAIL(hp_infras_->est_bucket_count(rows, width, min_bucket_cnt, max_bucket_cnt))) {
|
||||
LOG_WARN("failed to est bucket count", K(ret));
|
||||
}
|
||||
est_bucket_cnt = hp_infras_->est_bucket_count(rows, width, min_bucket_cnt, max_bucket_cnt);
|
||||
}
|
||||
return ret;
|
||||
return est_bucket_cnt;
|
||||
}
|
||||
|
||||
int ObHashPartInfrastructureVecImpl::set_funcs(
|
||||
|
||||
@ -659,7 +659,7 @@ OB_INLINE int ObBitVectorImpl<WordType>::inner_foreach(const ObBitVectorImpl<Wor
|
||||
if (tmp_step + step_size > size) {
|
||||
mini_cnt = size - tmp_step;
|
||||
}
|
||||
for (int64_t j = 0; j < mini_cnt; j++) {
|
||||
for (int64_t j = 0; OB_SUCC(ret) && j < mini_cnt; j++) {
|
||||
int64_t k = j + tmp_step;
|
||||
ret = op(k);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user