mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-27 12:10:49 +00:00
Small fixes to empty lines and style.
This commit is contained in:
parent
7f92e6a21f
commit
1e0e00b7e4
@ -9,13 +9,13 @@ distributed under the License is distributed on an "AS IS" BASIS,
|
|||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License. */
|
limitations under the License. */
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <optional>
|
#include <optional>
|
||||||
#include <Parsers/ASTAlterQuery.h>
|
#include <Parsers/ASTAlterQuery.h>
|
||||||
#include <Storages/LiveView/StorageLiveView.h>
|
#include <Storages/LiveView/StorageLiveView.h>
|
||||||
|
|
||||||
|
|
||||||
namespace DB
|
namespace DB
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@ distributed under the License is distributed on an "AS IS" BASIS,
|
|||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License. */
|
limitations under the License. */
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <Poco/Condition.h>
|
#include <Poco/Condition.h>
|
||||||
|
@ -1,66 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <Storages/IStorage.h>
|
|
||||||
|
|
||||||
namespace DB
|
|
||||||
{
|
|
||||||
|
|
||||||
class ProxyStorage : public IStorage
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
ProxyStorage(StoragePtr storage_, BlockInputStreams streams_, QueryProcessingStage::Enum to_stage_)
|
|
||||||
: storage(std::move(storage_)), streams(std::move(streams_)), to_stage(to_stage_) {}
|
|
||||||
|
|
||||||
public:
|
|
||||||
std::string getName() const override { return "ProxyStorage(" + storage->getName() + ")"; }
|
|
||||||
std::string getTableName() const override { return storage->getTableName(); }
|
|
||||||
|
|
||||||
bool isRemote() const override { return storage->isRemote(); }
|
|
||||||
bool supportsSampling() const override { return storage->supportsSampling(); }
|
|
||||||
bool supportsFinal() const override { return storage->supportsFinal(); }
|
|
||||||
bool supportsPrewhere() const override { return storage->supportsPrewhere(); }
|
|
||||||
bool supportsReplication() const override { return storage->supportsReplication(); }
|
|
||||||
bool supportsDeduplication() const override { return storage->supportsDeduplication(); }
|
|
||||||
|
|
||||||
QueryProcessingStage::Enum getQueryProcessingStage(const Context & /*context*/) const override { return to_stage; }
|
|
||||||
|
|
||||||
BlockInputStreams read(
|
|
||||||
const Names & /*column_names*/,
|
|
||||||
const SelectQueryInfo & /*query_info*/,
|
|
||||||
const Context & /*context*/,
|
|
||||||
QueryProcessingStage::Enum /*processed_stage*/,
|
|
||||||
size_t /*max_block_size*/,
|
|
||||||
unsigned /*num_streams*/) override
|
|
||||||
{
|
|
||||||
return streams;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool supportsIndexForIn() const override { return storage->supportsIndexForIn(); }
|
|
||||||
bool mayBenefitFromIndexForIn(const ASTPtr & left_in_operand, const Context & query_context) const override { return storage->mayBenefitFromIndexForIn(left_in_operand, query_context); }
|
|
||||||
ASTPtr getPartitionKeyAST() const override { return storage->getPartitionKeyAST(); }
|
|
||||||
ASTPtr getSortingKeyAST() const override { return storage->getSortingKeyAST(); }
|
|
||||||
ASTPtr getPrimaryKeyAST() const override { return storage->getPrimaryKeyAST(); }
|
|
||||||
ASTPtr getSamplingKeyAST() const override { return storage->getSamplingKeyAST(); }
|
|
||||||
Names getColumnsRequiredForPartitionKey() const override { return storage->getColumnsRequiredForPartitionKey(); }
|
|
||||||
Names getColumnsRequiredForSortingKey() const override { return storage->getColumnsRequiredForSortingKey(); }
|
|
||||||
Names getColumnsRequiredForPrimaryKey() const override { return storage->getColumnsRequiredForPrimaryKey(); }
|
|
||||||
Names getColumnsRequiredForSampling() const override { return storage->getColumnsRequiredForSampling(); }
|
|
||||||
Names getColumnsRequiredForFinal() const override { return storage->getColumnsRequiredForFinal(); }
|
|
||||||
|
|
||||||
const ColumnsDescription & getColumns() const override { return storage->getColumns(); }
|
|
||||||
void setColumns(ColumnsDescription columns_) override { return storage->setColumns(columns_); }
|
|
||||||
NameAndTypePair getColumn(const String & column_name) const override { return storage->getColumn(column_name); }
|
|
||||||
bool hasColumn(const String & column_name) const override { return storage->hasColumn(column_name); }
|
|
||||||
static StoragePtr createProxyStorage(StoragePtr storage, BlockInputStreams streams, QueryProcessingStage::Enum to_stage)
|
|
||||||
{
|
|
||||||
return std::make_shared<ProxyStorage>(std::move(storage), std::move(streams), to_stage);
|
|
||||||
}
|
|
||||||
private:
|
|
||||||
StoragePtr storage;
|
|
||||||
BlockInputStreams streams;
|
|
||||||
QueryProcessingStage::Enum to_stage;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -2,20 +2,25 @@
|
|||||||
|
|
||||||
#include <Storages/IStorage.h>
|
#include <Storages/IStorage.h>
|
||||||
|
|
||||||
|
|
||||||
namespace DB
|
namespace DB
|
||||||
{
|
{
|
||||||
|
|
||||||
class StorageBlocks : public IStorage
|
class StorageBlocks : public IStorage
|
||||||
{
|
{
|
||||||
|
/* Storage based on the prepared streams that already contain data blocks.
|
||||||
|
* Used by Live Views to complete stored query based on the mergeable blocks.
|
||||||
|
*/
|
||||||
public:
|
public:
|
||||||
StorageBlocks(const std::string & database_name_, const std::string & table_name_,
|
StorageBlocks(const std::string & database_name_, const std::string & table_name_,
|
||||||
const ColumnsDescription & columns_, BlockInputStreams streams_,
|
const ColumnsDescription & columns_, BlockInputStreams streams_,
|
||||||
QueryProcessingStage::Enum to_stage_)
|
QueryProcessingStage::Enum to_stage_)
|
||||||
: database_name(database_name_), table_name(table_name_), streams(streams_), to_stage(to_stage_)
|
: database_name(database_name_), table_name(table_name_), streams(streams_), to_stage(to_stage_)
|
||||||
{
|
{
|
||||||
setColumns(columns_);
|
setColumns(columns_);
|
||||||
}
|
}
|
||||||
static StoragePtr createStorage(std::string database_name, std::string table_name, const ColumnsDescription columns, BlockInputStreams streams, QueryProcessingStage::Enum to_stage)
|
static StoragePtr createStorage(std::string database_name, std::string table_name,
|
||||||
|
const ColumnsDescription columns, BlockInputStreams streams, QueryProcessingStage::Enum to_stage)
|
||||||
{
|
{
|
||||||
return std::make_shared<StorageBlocks>(std::move(database_name), std::move(table_name), std::move(columns), std::move(streams), to_stage);
|
return std::make_shared<StorageBlocks>(std::move(database_name), std::move(table_name), std::move(columns), std::move(streams), to_stage);
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,7 @@ limitations under the License. */
|
|||||||
#include <Interpreters/DatabaseAndTableWithAlias.h>
|
#include <Interpreters/DatabaseAndTableWithAlias.h>
|
||||||
#include <Interpreters/AddDefaultDatabaseVisitor.h>
|
#include <Interpreters/AddDefaultDatabaseVisitor.h>
|
||||||
|
|
||||||
|
|
||||||
namespace DB
|
namespace DB
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -159,8 +159,8 @@ private:
|
|||||||
String table_name;
|
String table_name;
|
||||||
String database_name;
|
String database_name;
|
||||||
ASTPtr inner_query; /// stored query : SELECT * FROM ( SELECT a FROM A)
|
ASTPtr inner_query; /// stored query : SELECT * FROM ( SELECT a FROM A)
|
||||||
ASTPtr inner_subquery; /// stored query's subquery if any : SLECT a FROM A
|
ASTPtr inner_subquery; /// stored query's innermost subquery if any
|
||||||
ASTPtr inner_outer_query; /// the query right before innermost subquery : ... SELECT * FROM ( subquery )
|
ASTPtr inner_outer_query; /// query right before innermost subquery
|
||||||
Context & global_context;
|
Context & global_context;
|
||||||
std::unique_ptr<Context> live_view_context;
|
std::unique_ptr<Context> live_view_context;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user