diff --git a/src/storage/blocksstable/index_block/ob_index_block_aggregator.cpp b/src/storage/blocksstable/index_block/ob_index_block_aggregator.cpp index 44ebf03c1c..41ed172b88 100644 --- a/src/storage/blocksstable/index_block/ob_index_block_aggregator.cpp +++ b/src/storage/blocksstable/index_block/ob_index_block_aggregator.cpp @@ -1034,7 +1034,12 @@ int ObSkipIndexDataAggregator::eval(const ObIMicroBlockWriter &data_micro_writer } } else if (can_agg_with_dict(static_cast(idx_col_meta.col_type_))) { // try aggregate with dict - if (pre_agg_param.use_cs_encoding_ht()) { + if (pre_agg_param.is_all_null_column()) { + tmp_result.set_null(); + if (OB_FAIL(col_aggs_.at(i)->eval(tmp_result, false))) { + LOG_WARN("failed to evaluate all null column", K(ret), K(pre_agg_param)); + } + } else if (pre_agg_param.use_cs_encoding_ht()) { if (OB_FAIL(do_col_agg(i, *pre_agg_param.cs_encoding_ht_))) { LOG_WARN("failed to do column aggregation with cs encoding hashtable", K(ret)); } @@ -1091,6 +1096,8 @@ int ObSkipIndexDataAggregator::do_col_agg_with_pre_agg_integer( } if (OB_FAIL(ret)) { + } else if (agg_param.is_all_null_column()) { + tmp_result.set_null(); } else if (type_class == ObIntTC) { switch (datum_type) { case OBJ_DATUM_8BYTE_DATA: { diff --git a/src/storage/blocksstable/index_block/ob_index_block_aggregator.h b/src/storage/blocksstable/index_block/ob_index_block_aggregator.h index c6df636ad0..ebe30cac30 100644 --- a/src/storage/blocksstable/index_block/ob_index_block_aggregator.h +++ b/src/storage/blocksstable/index_block/ob_index_block_aggregator.h @@ -146,6 +146,7 @@ struct ObMicroDataPreAggParam void reset() { memset(this, 0, sizeof(*this)); } bool use_encoding_ht() const { return is_pax_encoding_ && nullptr != encoding_ht_; } bool use_cs_encoding_ht() const { return is_cs_encoding_ && nullptr != cs_encoding_ht_; } + bool is_all_null_column() const { OB_ASSERT(nullptr != col_datums_); return null_cnt_ == col_datums_->count(); } TO_STRING_KV(KP_(col_datums), KP_(encoding_ht), K_(null_cnt), K_(min_integer), K_(max_integer), K_(is_integer_aggregated), K_(is_cs_encoding), K_(is_pax_encoding));