diff --git a/src/sql/engine/sort/ob_sort_op_impl.cpp b/src/sql/engine/sort/ob_sort_op_impl.cpp index b0d04bc4b7..57d5f7b041 100644 --- a/src/sql/engine/sort/ob_sort_op_impl.cpp +++ b/src/sql/engine/sort/ob_sort_op_impl.cpp @@ -1421,12 +1421,9 @@ int ObSortOpImpl::prepare_bucket_array(ArrayType *&buckets, uint64_t bucket_num) SQL_ENG_LOG(WARN, "failed to init bucket", K(ret), K(bucket_num)); } } else { - int64_t max_bucket_cnt = buckets->get_capacity(); - if (max_bucket_cnt < bucket_num) { - buckets->reuse(); - if (OB_FAIL(buckets->init(bucket_num))) { - LOG_WARN("failed to init bucket array", K(ret), K(bucket_num)); - } + buckets->reuse(); + if (OB_FAIL(buckets->init(bucket_num))) { + LOG_WARN("failed to init bucket array", K(ret), K(bucket_num)); } } return ret; diff --git a/src/sql/engine/sort/ob_sort_vec_op_impl.h b/src/sql/engine/sort/ob_sort_vec_op_impl.h index 7052e67d03..a2d669a30c 100644 --- a/src/sql/engine/sort/ob_sort_vec_op_impl.h +++ b/src/sql/engine/sort/ob_sort_vec_op_impl.h @@ -381,12 +381,9 @@ protected: SQL_ENG_LOG(WARN, "failed to init bucket", K(ret), K(bucket_num)); } } else { - int64_t max_bucket_cnt = buckets->get_capacity(); - if (max_bucket_cnt < bucket_num) { - buckets->reuse(); - if (OB_FAIL(buckets->init(bucket_num))) { - LOG_WARN("failed to init bucket array", K(ret), K(bucket_num)); - } + buckets->reuse(); + if (OB_FAIL(buckets->init(bucket_num))) { + LOG_WARN("failed to init bucket array", K(ret), K(bucket_num)); } } return ret;