Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions src/Processors/Formats/Impl/ParquetBlockOutputFormat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,10 @@ void ParquetBlockOutputFormat::consume(Chunk chunk)
/// Because the real SquashingTransform is only used for INSERT, not for SELECT ... INTO OUTFILE.
/// The latter doesn't even have a pipeline where a transform could be inserted, so it's more
/// convenient to do the squashing here. It's also parallelized here.

if (chunk.getNumRows() != 0)
{
staging_rows += chunk.getNumRows();
staging_bytes += chunk.bytes();
staging_bytes += chunk.allocatedBytes();
staging_chunks.push_back(std::move(chunk));
}

Expand Down Expand Up @@ -282,11 +281,15 @@ void ParquetBlockOutputFormat::writeRowGroup(std::vector<Chunk> chunks)
writeUsingArrow(std::move(chunks));
else
{
Chunk concatenated = std::move(chunks[0]);
for (size_t i = 1; i < chunks.size(); ++i)
concatenated.append(chunks[i]);
chunks.clear();

Chunk concatenated;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I understand, this affects the ordering of the data. I am not sure this is ok... @vdimir @liuneng1994

while (!chunks.empty())
{
if (concatenated.empty())
concatenated.swap(chunks.back());
else
concatenated.append(chunks.back());
chunks.pop_back();
}
writeRowGroupInOneThread(std::move(concatenated));
}
}
Expand Down