@@ -933,9 +933,9 @@ void ObIMultiColAggregator::reuse()
933933 if (agg_result_row_ != nullptr ) {
934934 for (int64_t i = 0 ; i < result_idxes_.count (); ++i) {
935935 const int64_t result_idx = result_idxes_.at (i);
936- if (OB_LIKELY (result_idx > 0 && result_idx < agg_result_row_->get_agg_col_cnt ())) {
937- agg_result_row_->get_agg_datum_row ().storage_datums_ [i ].reuse ();
938- agg_result_row_->get_agg_datum_row ().storage_datums_ [i ].set_null ();
936+ if (OB_LIKELY (result_idx >= 0 && result_idx < agg_result_row_->get_agg_col_cnt ())) {
937+ agg_result_row_->get_agg_datum_row ().storage_datums_ [result_idx ].reuse ();
938+ agg_result_row_->get_agg_datum_row ().storage_datums_ [result_idx ].set_null ();
939939 }
940940 }
941941 }
@@ -980,7 +980,7 @@ int ObBM25ParamAggregator::init(
980980 result_idxes_.at (TOKEN_FREQ_IDX) = i;
981981 col_agg_metas_.at (TOKEN_FREQ_IDX) = idx_col_meta;
982982 agg_result_row.get_agg_datum_row ().storage_datums_ [i].reuse ();
983- agg_result_row.get_agg_datum_row ().storage_datums_ [i].set_null ( );
983+ agg_result_row.get_agg_datum_row ().storage_datums_ [i].set_uint ( 0 );
984984 }
985985 } else if (idx_col_meta.get_col_type () == SK_IDX_BM25_MAX_SCORE_DOC_LEN) {
986986 if (OB_UNLIKELY (found_doc_length)) {
@@ -995,7 +995,7 @@ int ObBM25ParamAggregator::init(
995995 result_idxes_.at (DOC_LENGTH_IDX) = i;
996996 col_agg_metas_.at (DOC_LENGTH_IDX) = idx_col_meta;
997997 agg_result_row.get_agg_datum_row ().storage_datums_ [i].reuse ();
998- agg_result_row.get_agg_datum_row ().storage_datums_ [i].set_null ( );
998+ agg_result_row.get_agg_datum_row ().storage_datums_ [i].set_uint ( 0 );
999999 }
10001000 }
10011001 }
@@ -1026,6 +1026,16 @@ void ObBM25ParamAggregator::reset()
10261026void ObBM25ParamAggregator::reuse ()
10271027{
10281028 ObIMultiColAggregator::reuse ();
1029+ if (nullptr != agg_result_row_ && result_idxes_.count () >= 2 ) {
1030+ const int64_t token_freq_result_idx = result_idxes_.at (TOKEN_FREQ_IDX);
1031+ const int64_t doc_length_result_idx = result_idxes_.at (DOC_LENGTH_IDX);
1032+ if (OB_LIKELY (token_freq_result_idx >= 0 && token_freq_result_idx < agg_result_row_->get_agg_col_cnt ())) {
1033+ agg_result_row_->get_agg_datum_row ().storage_datums_ [token_freq_result_idx].set_uint (0 );
1034+ }
1035+ if (OB_LIKELY (doc_length_result_idx >= 0 && doc_length_result_idx < agg_result_row_->get_agg_col_cnt ())) {
1036+ agg_result_row_->get_agg_datum_row ().storage_datums_ [doc_length_result_idx].set_uint (0 );
1037+ }
1038+ }
10291039 curr_max_score_ = 0.0 ;
10301040}
10311041
@@ -1955,8 +1965,7 @@ int ObIndexBlockAggregator::init(const ObDataStoreDesc &store_desc, ObIAllocator
19551965 ret = OB_INIT_TWICE;
19561966 LOG_WARN (" Already inited" , K (ret));
19571967 } else {
1958- need_data_aggregate_ = store_desc.get_agg_meta_array ().count () != 0
1959- && store_desc.is_major_or_meta_merge_type ();
1968+ need_data_aggregate_ = store_desc.get_agg_meta_array ().count () != 0 ;
19601969 if (!need_data_aggregate_) {
19611970 } else if (OB_FAIL (skip_index_aggregator_.init (
19621971 store_desc.is_major_or_meta_merge_type (),
0 commit comments