diff --git a/be/src/vec/olap/vcollect_iterator.cpp b/be/src/vec/olap/vcollect_iterator.cpp index d17ce910f59b6a..6ad8202ad4ae21 100644 --- a/be/src/vec/olap/vcollect_iterator.cpp +++ b/be/src/vec/olap/vcollect_iterator.cpp @@ -341,7 +341,7 @@ Status VCollectIterator::_topn_next(Block* block) { DCHECK(block->get_by_position(k).type->equals( *mutable_block.get_datatype_by_position(k))); res = block->get_by_position(k).column->compare_at( - k, last_row_pos, *(mutable_block.get_column_by_position(k)), -1); + j, last_row_pos, *(mutable_block.get_column_by_position(k)), -1); if (res) { break; }