diff --git a/be/src/vec/runtime/vfile_result_writer.cpp b/be/src/vec/runtime/vfile_result_writer.cpp index fe4994256adf0c..93b60bc1bf2dd5 100644 --- a/be/src/vec/runtime/vfile_result_writer.cpp +++ b/be/src/vec/runtime/vfile_result_writer.cpp @@ -426,7 +426,11 @@ Status VFileResultWriter::_create_new_file_if_exceed_size() { Status VFileResultWriter::_close_file_writer(bool done, bool only_close) { if (_vfile_writer) { _vfile_writer->close(); - COUNTER_UPDATE(_written_data_bytes, _current_written_bytes); + // we can not use _current_written_bytes to COUNTER_UPDATE(_written_data_bytes, _current_written_bytes) + // because it will call `write()` function of orc/parquet function in `_vfile_writer->close()` + // and the real written_len will increase + // and _current_written_bytes will less than _vfile_writer->written_len() + COUNTER_UPDATE(_written_data_bytes, _vfile_writer->written_len()); _vfile_writer.reset(nullptr); } else if (_file_writer_impl) { _file_writer_impl->close();