diff --git a/be/src/olap/compaction.cpp b/be/src/olap/compaction.cpp index b889a0fe70..a6ad5f6ee5 100644 --- a/be/src/olap/compaction.cpp +++ b/be/src/olap/compaction.cpp @@ -604,9 +604,10 @@ Status Compaction::construct_output_rowset_writer(RowsetWriterContext& ctx, bool std::string file_str = p.filename().string(); lucene::store::Directory* dir = DorisCompoundDirectory::getDirectory(fs, dir_str.c_str()); - auto reader = new DorisCompoundReader(dir, file_str.c_str()); + DorisCompoundReader reader(dir, file_str.c_str()); std::vector files; - reader->list(&files); + reader.list(&files); + reader.close(); // why is 3? // bkd index will write at least 3 files