mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-18 05:32:52 +00:00
fix
This commit is contained in:
parent
d9a77e3a1a
commit
1b2416007e
@ -77,6 +77,7 @@ namespace ErrorCodes
|
|||||||
{
|
{
|
||||||
extern const int INTO_OUTFILE_NOT_ALLOWED;
|
extern const int INTO_OUTFILE_NOT_ALLOWED;
|
||||||
extern const int QUERY_WAS_CANCELLED;
|
extern const int QUERY_WAS_CANCELLED;
|
||||||
|
extern const int LOGICAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1059,12 +1060,6 @@ void executeQuery(
|
|||||||
copyData(*streams.in, *out, [](){ return false; }, [&out](const Block &) { out->flush(); });
|
copyData(*streams.in, *out, [](){ return false; }, [&out](const Block &) { out->flush(); });
|
||||||
}
|
}
|
||||||
else if (pipeline.initialized())
|
else if (pipeline.initialized())
|
||||||
{
|
|
||||||
if (pipeline.isCompleted())
|
|
||||||
{
|
|
||||||
pipeline.setProgressCallback(context->getProgressCallback());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
const ASTQueryWithOutput * ast_query_with_output = dynamic_cast<const ASTQueryWithOutput *>(ast.get());
|
const ASTQueryWithOutput * ast_query_with_output = dynamic_cast<const ASTQueryWithOutput *>(ast.get());
|
||||||
|
|
||||||
@ -1084,6 +1079,8 @@ void executeQuery(
|
|||||||
? getIdentifierName(ast_query_with_output->format)
|
? getIdentifierName(ast_query_with_output->format)
|
||||||
: context->getDefaultFormat();
|
: context->getDefaultFormat();
|
||||||
|
|
||||||
|
if (!pipeline.isCompleted())
|
||||||
|
{
|
||||||
pipeline.addSimpleTransform([](const Block & header)
|
pipeline.addSimpleTransform([](const Block & header)
|
||||||
{
|
{
|
||||||
return std::make_shared<MaterializingTransform>(header);
|
return std::make_shared<MaterializingTransform>(header);
|
||||||
@ -1109,6 +1106,10 @@ void executeQuery(
|
|||||||
|
|
||||||
pipeline.setOutputFormat(std::move(out));
|
pipeline.setOutputFormat(std::move(out));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pipeline.setProgressCallback(context->getProgressCallback());
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
auto executor = pipeline.execute();
|
auto executor = pipeline.execute();
|
||||||
|
@ -1138,9 +1138,16 @@ ActionLock StorageDistributed::getActionLock(StorageActionBlockType type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void StorageDistributed::flush()
|
void StorageDistributed::flush()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
flushClusterNodesAllData(getContext());
|
flushClusterNodesAllData(getContext());
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
tryLogCurrentException(log, "Cannot flush");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void StorageDistributed::flushClusterNodesAllData(ContextPtr local_context)
|
void StorageDistributed::flushClusterNodesAllData(ContextPtr local_context)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user