We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1e0405e commit ba358afCopy full SHA for ba358af
src/data/sparse_page_source.h
@@ -162,7 +162,12 @@ class SparsePageSourceImpl : public BatchIteratorImpl<S> {
162
std::unique_ptr<SparsePageFormat<S>> fmt{CreatePageFormat<S>("raw")};
163
164
auto name = cache_info_->ShardName();
165
- std::unique_ptr<dmlc::Stream> fo{dmlc::Stream::Create(name.c_str(), "a")};
+ std::unique_ptr<dmlc::Stream> fo;
166
+ if (this->Iter() == 0) {
167
+ fo.reset(dmlc::Stream::Create(name.c_str(), "w"));
168
+ } else {
169
+ fo.reset(dmlc::Stream::Create(name.c_str(), "a"));
170
+ }
171
172
auto bytes = fmt->Write(*page_, fo.get());
173
0 commit comments