2020-10-10 18:37:02 +00:00
|
|
|
#pragma once
|
2019-05-26 22:03:30 +00:00
|
|
|
/* Copyright (c) 2018 BlackBerry Limited
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License. */
|
|
|
|
|
|
|
|
#include <Core/QueryProcessingStage.h>
|
2021-10-15 20:18:20 +00:00
|
|
|
#include <QueryPipeline/BlockIO.h>
|
2019-05-26 22:03:30 +00:00
|
|
|
#include <Interpreters/IInterpreter.h>
|
2021-04-10 23:33:54 +00:00
|
|
|
#include <Parsers/IAST_fwd.h>
|
2022-01-10 19:01:41 +00:00
|
|
|
#include <Storages/IStorage_fwd.h>
|
2021-04-10 23:33:54 +00:00
|
|
|
#include <Storages/SelectQueryInfo.h>
|
2019-05-26 22:03:30 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
class IAST;
|
|
|
|
using ASTPtr = std::shared_ptr<IAST>;
|
|
|
|
using StoragePtr = std::shared_ptr<IStorage>;
|
|
|
|
|
2021-04-10 23:33:54 +00:00
|
|
|
class InterpreterWatchQuery : public IInterpreter, WithContext
|
2019-05-26 22:03:30 +00:00
|
|
|
{
|
|
|
|
public:
|
2021-04-10 23:33:54 +00:00
|
|
|
InterpreterWatchQuery(const ASTPtr & query_ptr_, ContextPtr context_) : WithContext(context_), query_ptr(query_ptr_) {}
|
2019-05-26 22:03:30 +00:00
|
|
|
|
|
|
|
BlockIO execute() override;
|
2021-09-16 17:40:42 +00:00
|
|
|
QueryPipelineBuilder buildQueryPipeline();
|
2019-05-26 22:03:30 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
ASTPtr query_ptr;
|
|
|
|
|
|
|
|
/// Table from where to read data, if not subquery.
|
|
|
|
StoragePtr storage;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|