mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Fix empty output of arrow related formats
This commit is contained in:
parent
d4266d9619
commit
dadcca6c08
@ -43,13 +43,17 @@ void ArrowBlockOutputFormat::consume(Chunk chunk)
|
||||
|
||||
void ArrowBlockOutputFormat::finalize()
|
||||
{
|
||||
if (writer)
|
||||
if (!writer)
|
||||
{
|
||||
auto status = writer->Close();
|
||||
if (!status.ok())
|
||||
throw Exception(ErrorCodes::UNKNOWN_EXCEPTION,
|
||||
"Error while closing a table: {}", status.ToString());
|
||||
const Block & header = getPort(PortKind::Main).getHeader();
|
||||
|
||||
consume(Chunk(header.columns(), 0));
|
||||
}
|
||||
|
||||
auto status = writer->Close();
|
||||
if (!status.ok())
|
||||
throw Exception(ErrorCodes::UNKNOWN_EXCEPTION,
|
||||
"Error while closing a table: {}", status.ToString());
|
||||
}
|
||||
|
||||
void ArrowBlockOutputFormat::prepareWriter(const std::shared_ptr<arrow::Schema> & schema)
|
||||
|
@ -66,12 +66,16 @@ void ParquetBlockOutputFormat::consume(Chunk chunk)
|
||||
|
||||
void ParquetBlockOutputFormat::finalize()
|
||||
{
|
||||
if (file_writer)
|
||||
if (!file_writer)
|
||||
{
|
||||
auto status = file_writer->Close();
|
||||
if (!status.ok())
|
||||
throw Exception{"Error while closing a table: " + status.ToString(), ErrorCodes::UNKNOWN_EXCEPTION};
|
||||
const Block & header = getPort(PortKind::Main).getHeader();
|
||||
|
||||
consume(Chunk(header.columns(), 0));
|
||||
}
|
||||
|
||||
auto status = file_writer->Close();
|
||||
if (!status.ok())
|
||||
throw Exception{"Error while closing a table: " + status.ToString(), ErrorCodes::UNKNOWN_EXCEPTION};
|
||||
}
|
||||
|
||||
void registerOutputFormatProcessorParquet(FormatFactory & factory)
|
||||
|
Loading…
Reference in New Issue
Block a user