Finalize CompressedWriteBuffer in TemporaryFileStream

This commit is contained in:
vdimir 2021-05-11 12:23:35 +03:00
parent 066d02dd2f
commit adb5fe2f30
No known key found for this signature in database
GPG Key ID: F57B3E10A21DBB31

View File

@ -19,7 +19,7 @@ struct TemporaryFileStream
CompressedReadBuffer compressed_in;
BlockInputStreamPtr block_in;
TemporaryFileStream(const std::string & path)
explicit TemporaryFileStream(const std::string & path)
: file_in(path)
, compressed_in(file_in)
, block_in(std::make_shared<NativeBlockInputStream>(compressed_in, DBMS_TCP_PROTOCOL_VERSION))
@ -39,6 +39,7 @@ struct TemporaryFileStream
CompressedWriteBuffer compressed_buf(file_buf, CompressionCodecFactory::instance().get(codec, {}));
NativeBlockOutputStream output(compressed_buf, 0, header);
copyData(input, output, is_cancelled);
compressed_buf.finalize();
}
};