mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-17 13:13:36 +00:00
Fix more tests again
This commit is contained in:
parent
4e7d5191e3
commit
12a4c74af0
@ -602,8 +602,6 @@ static void logQueryViews(std::list<ViewRuntimeData> & views, ContextPtr context
|
||||
|
||||
try
|
||||
{
|
||||
//std::cerr << "============ Logging for " << static_cast<const void *>(view.runtime_stats.thread_status.get()) << ' ' << view.table_id.getNameForLogs() << "\n";
|
||||
|
||||
if (view.runtime_stats.thread_status)
|
||||
view.runtime_stats.thread_status->logToQueryViewsLog(view);
|
||||
}
|
||||
|
@ -217,7 +217,7 @@ BlockIO getDistributedDDLStatus(const String & node_path, const DDLLogEntry & en
|
||||
io.pipeline = QueryPipeline(std::move(source));
|
||||
|
||||
if (context->getSettingsRef().distributed_ddl_output_mode == DistributedDDLOutputMode::NONE)
|
||||
io.pipeline.complete(Pipe(std::make_shared<EmptySink>(io.pipeline.getHeader())));
|
||||
io.pipeline.complete(std::make_shared<EmptySink>(io.pipeline.getHeader()));
|
||||
|
||||
return io;
|
||||
}
|
||||
|
@ -657,13 +657,13 @@ static std::tuple<ASTPtr, BlockIO> executeQueryImpl(
|
||||
/// Hold element of process list till end of query execution.
|
||||
res.process_list_entry = process_list_entry;
|
||||
|
||||
if (pipeline.pulling())
|
||||
if (pipeline.pulling() || pipeline.completed())
|
||||
{
|
||||
/// Limits on the result, the quota on the result, and also callback for progress.
|
||||
/// Limits apply only to the final result.
|
||||
pipeline.setProgressCallback(context->getProgressCallback());
|
||||
pipeline.setProcessListElement(context->getProcessListElement());
|
||||
if (stage == QueryProcessingStage::Complete)
|
||||
if (stage == QueryProcessingStage::Complete && pipeline.pulling())
|
||||
pipeline.setLimitsAndQuota(limits, quota);
|
||||
}
|
||||
else if (pipeline.pushing())
|
||||
|
@ -322,6 +322,19 @@ static void drop(OutputPort *& port, Processors & processors)
|
||||
|
||||
QueryPipeline::QueryPipeline(std::shared_ptr<SinkToStorage> sink) : QueryPipeline(Chain(std::move(sink))) {}
|
||||
|
||||
void QueryPipeline::complete(std::shared_ptr<ISink> sink)
|
||||
{
|
||||
if (!pulling())
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Pipeline must be pulling to be completed with chain");
|
||||
|
||||
drop(totals, processors);
|
||||
drop(extremes, processors);
|
||||
|
||||
connect(*output, sink->getPort());
|
||||
processors.emplace_back(std::move(sink));
|
||||
output = nullptr;
|
||||
}
|
||||
|
||||
void QueryPipeline::complete(Chain chain)
|
||||
{
|
||||
if (!pulling())
|
||||
@ -444,7 +457,7 @@ void QueryPipeline::setProcessListElement(QueryStatus * elem)
|
||||
{
|
||||
process_list_element = elem;
|
||||
|
||||
if (pulling())
|
||||
if (pulling() || completed())
|
||||
{
|
||||
for (auto & processor : processors)
|
||||
{
|
||||
@ -467,7 +480,7 @@ void QueryPipeline::setLimitsAndQuota(const StreamLocalLimits & limits, std::sha
|
||||
if (!pulling())
|
||||
throw Exception(
|
||||
ErrorCodes::LOGICAL_ERROR,
|
||||
"It is possible to set limits and quota only to pullint QueryPipeline");
|
||||
"It is possible to set limits and quota only to pulling QueryPipeline");
|
||||
|
||||
auto transform = std::make_shared<LimitsCheckingTransform>(output->getHeader(), limits);
|
||||
transform->setQuota(quota);
|
||||
|
@ -25,6 +25,7 @@ class Chain;
|
||||
class IOutputFormat;
|
||||
class SinkToStorage;
|
||||
class ISource;
|
||||
class ISink;
|
||||
|
||||
class QueryPipeline
|
||||
{
|
||||
@ -79,6 +80,7 @@ public:
|
||||
void complete(std::shared_ptr<IOutputFormat> format);
|
||||
void complete(Chain chain);
|
||||
void complete(std::shared_ptr<SinkToStorage> sink);
|
||||
void complete(std::shared_ptr<ISink> sink);
|
||||
|
||||
/// Only for pushing and pulling.
|
||||
Block getHeader() const;
|
||||
|
Loading…
Reference in New Issue
Block a user