diff --git a/be/src/olap/rowset/segment_v2/segment_iterator.cpp b/be/src/olap/rowset/segment_v2/segment_iterator.cpp index 6bc01ea0d4be6e..5c30423bb53d44 100644 --- a/be/src/olap/rowset/segment_v2/segment_iterator.cpp +++ b/be/src/olap/rowset/segment_v2/segment_iterator.cpp @@ -2074,7 +2074,8 @@ Status SegmentIterator::_read_columns_by_rowids(std::vector& read_colu Status SegmentIterator::next_batch(vectorized::Block* block) { auto status = [&]() { RETURN_IF_CATCH_EXCEPTION({ return _next_batch_internal(block); }); }(); - if (!status.ok()) { + // if rows read by batch is 0, will return end of file, we should not remove segment cache in this situation. + if (!status.ok() && !status.is()) { _segment->remove_from_segment_cache(); } return status;