From d757f3230061bc727a55e8c92ee9c4edf5854a6d Mon Sep 17 00:00:00 2001 From: Alexander Kuzmenkov Date: Fri, 11 Dec 2020 02:56:57 +0300 Subject: [PATCH] Remove some redundant includes to speed up build --- .../AggregateFunctionSequenceMatch.h | 2 +- src/Columns/ColumnLowCardinality.h | 1 - src/Common/ColumnsHashingImpl.h | 1 + src/DataTypes/DataTypeLowCardinality.cpp | 1 + src/Interpreters/ExpressionAnalyzer.cpp | 1 + src/Interpreters/HashJoin.h | 1 + src/Interpreters/IJoin.h | 1 + src/Interpreters/InterpreterCreateQuery.h | 2 ++ src/Interpreters/InterpreterRenameQuery.h | 1 + src/Interpreters/InterpreterSelectQuery.cpp | 2 ++ src/Interpreters/MySQL/InterpretersMySQLDDLQuery.cpp | 2 ++ src/Interpreters/TextLog.cpp | 11 +++++++---- src/Storages/ConstraintsDescription.cpp | 3 +++ src/Storages/ConstraintsDescription.h | 2 +- src/Storages/LiveView/StorageLiveView.cpp | 6 ++++++ src/Storages/LiveView/StorageLiveView.h | 2 +- src/Storages/MergeTree/MergeTreeData.h | 1 + src/Storages/ReadInOrderOptimizer.cpp | 6 ++++-- src/Storages/StorageMaterializeMySQL.cpp | 4 ++++ .../System/StorageSystemDistributionQueue.cpp | 1 + src/Storages/System/StorageSystemTables.cpp | 1 + src/Storages/System/StorageSystemZooKeeper.cpp | 1 + src/Storages/System/attachSystemTablesImpl.h | 2 ++ 23 files changed, 45 insertions(+), 10 deletions(-) diff --git a/src/AggregateFunctions/AggregateFunctionSequenceMatch.h b/src/AggregateFunctions/AggregateFunctionSequenceMatch.h index c7e2a700dd..1a3da20e34 100644 --- a/src/AggregateFunctions/AggregateFunctionSequenceMatch.h +++ b/src/AggregateFunctions/AggregateFunctionSequenceMatch.h @@ -590,7 +590,7 @@ public: void insertResultInto(AggregateDataPtr place, IColumn & to, Arena *) const override { - const_cast(this->data(place)).sort(); + this->data(place).sort(); assert_cast(to).getData().push_back(count(place)); } diff --git a/src/Columns/ColumnLowCardinality.h b/src/Columns/ColumnLowCardinality.h index 0874f619b8..5ace0a5d64 100644 --- a/src/Columns/ColumnLowCardinality.h +++ b/src/Columns/ColumnLowCardinality.h @@ -3,7 +3,6 @@ #include #include #include -#include #include "ColumnsNumber.h" diff --git a/src/Common/ColumnsHashingImpl.h b/src/Common/ColumnsHashingImpl.h index 826e8d31ee..cdd8dd20dd 100644 --- a/src/Common/ColumnsHashingImpl.h +++ b/src/Common/ColumnsHashingImpl.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include #include diff --git a/src/DataTypes/DataTypeLowCardinality.cpp b/src/DataTypes/DataTypeLowCardinality.cpp index 6b1166dc26..8f4b2bf763 100644 --- a/src/DataTypes/DataTypeLowCardinality.cpp +++ b/src/DataTypes/DataTypeLowCardinality.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/src/Interpreters/ExpressionAnalyzer.cpp b/src/Interpreters/ExpressionAnalyzer.cpp index 1a112e9fef..72d48efdd8 100644 --- a/src/Interpreters/ExpressionAnalyzer.cpp +++ b/src/Interpreters/ExpressionAnalyzer.cpp @@ -10,6 +10,7 @@ #include #include +#include #include #include diff --git a/src/Interpreters/HashJoin.h b/src/Interpreters/HashJoin.h index 986b447447..ceddc9e4c7 100644 --- a/src/Interpreters/HashJoin.h +++ b/src/Interpreters/HashJoin.h @@ -22,6 +22,7 @@ #include #include +#include namespace DB { diff --git a/src/Interpreters/IJoin.h b/src/Interpreters/IJoin.h index b9f88b57b3..3d313adcb6 100644 --- a/src/Interpreters/IJoin.h +++ b/src/Interpreters/IJoin.h @@ -12,6 +12,7 @@ namespace DB class Block; struct ExtraBlock; +using ExtraBlockPtr = std::shared_ptr; class IJoin { diff --git a/src/Interpreters/InterpreterCreateQuery.h b/src/Interpreters/InterpreterCreateQuery.h index 07fca5f391..735cc2122f 100644 --- a/src/Interpreters/InterpreterCreateQuery.h +++ b/src/Interpreters/InterpreterCreateQuery.h @@ -16,6 +16,8 @@ class Context; class ASTCreateQuery; class ASTExpressionList; class ASTConstraintDeclaration; +class IDatabase; +using DatabasePtr = std::shared_ptr; /** Allows to create new table or database, diff --git a/src/Interpreters/InterpreterRenameQuery.h b/src/Interpreters/InterpreterRenameQuery.h index f2c08f2260..6fb0803d03 100644 --- a/src/Interpreters/InterpreterRenameQuery.h +++ b/src/Interpreters/InterpreterRenameQuery.h @@ -9,6 +9,7 @@ namespace DB class Context; class AccessRightsElements; +class DDLGuard; /// To avoid deadlocks, we must acquire locks for tables in same order in any different RENAMES. struct UniqueTableName diff --git a/src/Interpreters/InterpreterSelectQuery.cpp b/src/Interpreters/InterpreterSelectQuery.cpp index 43c5102fa3..f5c71570de 100644 --- a/src/Interpreters/InterpreterSelectQuery.cpp +++ b/src/Interpreters/InterpreterSelectQuery.cpp @@ -14,6 +14,8 @@ #include +#include + #include #include #include diff --git a/src/Interpreters/MySQL/InterpretersMySQLDDLQuery.cpp b/src/Interpreters/MySQL/InterpretersMySQLDDLQuery.cpp index 37714c1a83..2f8a544103 100644 --- a/src/Interpreters/MySQL/InterpretersMySQLDDLQuery.cpp +++ b/src/Interpreters/MySQL/InterpretersMySQLDDLQuery.cpp @@ -21,6 +21,8 @@ #include #include #include +#include +#include #include namespace DB diff --git a/src/Interpreters/TextLog.cpp b/src/Interpreters/TextLog.cpp index d1cc6a052e..f60b6acae6 100644 --- a/src/Interpreters/TextLog.cpp +++ b/src/Interpreters/TextLog.cpp @@ -1,11 +1,14 @@ #include -#include -#include + +#include +#include #include #include -#include +#include +#include #include -#include +#include + #include namespace DB diff --git a/src/Storages/ConstraintsDescription.cpp b/src/Storages/ConstraintsDescription.cpp index cff0b975a1..e6315872a6 100644 --- a/src/Storages/ConstraintsDescription.cpp +++ b/src/Storages/ConstraintsDescription.cpp @@ -1,5 +1,8 @@ #include +#include +#include + #include #include #include diff --git a/src/Storages/ConstraintsDescription.h b/src/Storages/ConstraintsDescription.h index ddc9597f81..d6d2baefbd 100644 --- a/src/Storages/ConstraintsDescription.h +++ b/src/Storages/ConstraintsDescription.h @@ -1,7 +1,7 @@ #pragma once #include -#include +#include namespace DB { diff --git a/src/Storages/LiveView/StorageLiveView.cpp b/src/Storages/LiveView/StorageLiveView.cpp index bdf82307b0..0803b3a9c9 100644 --- a/src/Storages/LiveView/StorageLiveView.cpp +++ b/src/Storages/LiveView/StorageLiveView.cpp @@ -35,6 +35,7 @@ limitations under the License. */ #include #include #include +#include #include #include #include @@ -303,6 +304,11 @@ Block StorageLiveView::getHeader() const return sample_block; } +StoragePtr StorageLiveView::getParentStorage() const +{ + return DatabaseCatalog::instance().getTable(select_table_id, global_context); +} + ASTPtr StorageLiveView::getInnerBlocksQuery() { std::lock_guard lock(sample_block_lock); diff --git a/src/Storages/LiveView/StorageLiveView.h b/src/Storages/LiveView/StorageLiveView.h index 9c843dc71d..4a03e29342 100644 --- a/src/Storages/LiveView/StorageLiveView.h +++ b/src/Storages/LiveView/StorageLiveView.h @@ -57,7 +57,7 @@ public: { return getStorageID().table_name + "_blocks"; } - StoragePtr getParentStorage() const { return DatabaseCatalog::instance().getTable(select_table_id, global_context); } + StoragePtr getParentStorage() const; ASTPtr getInnerQuery() const { return inner_query->clone(); } ASTPtr getInnerSubQuery() const diff --git a/src/Storages/MergeTree/MergeTreeData.h b/src/Storages/MergeTree/MergeTreeData.h index 1f9ca97aba..38e6c34e23 100644 --- a/src/Storages/MergeTree/MergeTreeData.h +++ b/src/Storages/MergeTree/MergeTreeData.h @@ -43,6 +43,7 @@ struct JobAndPool; class ExpressionActions; using ExpressionActionsPtr = std::shared_ptr; +using ManyExpressionActions = std::vector; namespace ErrorCodes { diff --git a/src/Storages/ReadInOrderOptimizer.cpp b/src/Storages/ReadInOrderOptimizer.cpp index 3613fbff5c..ae49433dbc 100644 --- a/src/Storages/ReadInOrderOptimizer.cpp +++ b/src/Storages/ReadInOrderOptimizer.cpp @@ -1,8 +1,10 @@ #include + +#include +#include +#include #include #include -#include -#include namespace DB { diff --git a/src/Storages/StorageMaterializeMySQL.cpp b/src/Storages/StorageMaterializeMySQL.cpp index 7c9ec35f3c..9be285adc6 100644 --- a/src/Storages/StorageMaterializeMySQL.cpp +++ b/src/Storages/StorageMaterializeMySQL.cpp @@ -8,6 +8,8 @@ #include #include +#include +#include #include #include @@ -19,6 +21,8 @@ #include #include +#include + namespace DB { diff --git a/src/Storages/System/StorageSystemDistributionQueue.cpp b/src/Storages/System/StorageSystemDistributionQueue.cpp index c8d8c88ec0..edba7c13b1 100644 --- a/src/Storages/System/StorageSystemDistributionQueue.cpp +++ b/src/Storages/System/StorageSystemDistributionQueue.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include diff --git a/src/Storages/System/StorageSystemTables.cpp b/src/Storages/System/StorageSystemTables.cpp index 02aa7d8302..c9b3223ee3 100644 --- a/src/Storages/System/StorageSystemTables.cpp +++ b/src/Storages/System/StorageSystemTables.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include diff --git a/src/Storages/System/StorageSystemZooKeeper.cpp b/src/Storages/System/StorageSystemZooKeeper.cpp index a3660cf2de..287650ef86 100644 --- a/src/Storages/System/StorageSystemZooKeeper.cpp +++ b/src/Storages/System/StorageSystemZooKeeper.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include diff --git a/src/Storages/System/attachSystemTablesImpl.h b/src/Storages/System/attachSystemTablesImpl.h index 0dc34c3c11..78e944f7d2 100644 --- a/src/Storages/System/attachSystemTablesImpl.h +++ b/src/Storages/System/attachSystemTablesImpl.h @@ -1,6 +1,8 @@ #pragma once #include +#include + namespace DB { -- GitLab