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.
2 parents a9f62d1 + a1c57b1 commit a305168Copy full SHA for a305168
src/Processors/Formats/Impl/ParquetBlockOutputFormat.cpp
@@ -306,13 +306,17 @@ void ParquetBlockOutputFormat::writeRowGroup(std::vector<Chunk> chunks)
306
else
307
{
308
Chunk concatenated;
309
- while (!chunks.empty())
+ for (auto & chunk : chunks)
310
311
if (concatenated.empty())
312
- concatenated.swap(chunks.back());
+ {
313
+ concatenated.swap(chunk);
314
+ }
315
- concatenated.append(chunks.back());
- chunks.pop_back();
316
317
+ concatenated.append(chunk);
318
+ chunk.clear(); // free chunk's buffers so memory is release earlier
319
320
}
321
writeRowGroupInOneThread(std::move(concatenated));
322
0 commit comments