diff --git a/dbms/src/Compression/CompressionFactory.h b/dbms/src/Compression/CompressionFactory.h index db28a19201154f0e3ee2f848bdde87db45fef125..b36bed1cf8eb07228ef4499bbb57dc200e1ce18a 100644 --- a/dbms/src/Compression/CompressionFactory.h +++ b/dbms/src/Compression/CompressionFactory.h @@ -1,14 +1,17 @@ #pragma once -#include +#include +#include +#include +#include +#include + +#include + #include +#include #include #include -#include -#include -#include -#include -#include namespace DB { @@ -19,10 +22,6 @@ using CompressionCodecPtr = std::shared_ptr; using CodecNameWithLevel = std::pair>; -class IAST; - -using ASTPtr = std::shared_ptr; - /** Creates a codec object by name of compression algorithm family and parameters. */ class CompressionCodecFactory final : public ext::singleton diff --git a/dbms/src/DataTypes/DataTypeFactory.h b/dbms/src/DataTypes/DataTypeFactory.h index 95cda9002f4e221d66d07b6906a8a86a29c70a44..c6ef100bbb79ece7d5a0a94a40bc97cb557d3bec 100644 --- a/dbms/src/DataTypes/DataTypeFactory.h +++ b/dbms/src/DataTypes/DataTypeFactory.h @@ -1,12 +1,15 @@ #pragma once -#include -#include -#include -#include #include +#include +#include + #include +#include +#include +#include + namespace DB { @@ -17,9 +20,6 @@ using DataTypePtr = std::shared_ptr; class IDataTypeDomain; using DataTypeDomainPtr = std::unique_ptr; -class IAST; -using ASTPtr = std::shared_ptr; - /** Creates a data type by name of data type family and parameters. */ diff --git a/dbms/src/Databases/IDatabase.h b/dbms/src/Databases/IDatabase.h index e6b67a87c9b8faffc2c746aac2ec12c99c814f29..7c0d501fc60e6019c0971176ac198ec263f71eec 100644 --- a/dbms/src/Databases/IDatabase.h +++ b/dbms/src/Databases/IDatabase.h @@ -1,16 +1,18 @@ #pragma once -#include #include +#include +#include +#include #include #include -#include -#include -#include #include -#include #include -#include +#include + +#include +#include +#include namespace DB @@ -21,9 +23,6 @@ class Context; class IStorage; using StoragePtr = std::shared_ptr; -class IAST; -using ASTPtr = std::shared_ptr; - struct Settings; @@ -157,4 +156,3 @@ using DatabasePtr = std::shared_ptr; using Databases = std::map; } - diff --git a/dbms/src/Interpreters/Aliases.h b/dbms/src/Interpreters/Aliases.h index 80976c7551f10c7d79950460f2669e82cd757273..521594422243e60bb602b9552e7922c4147a7735 100644 --- a/dbms/src/Interpreters/Aliases.h +++ b/dbms/src/Interpreters/Aliases.h @@ -1,15 +1,13 @@ #pragma once -#include - #include +#include + +#include namespace DB { -class IAST; -using ASTPtr = std::shared_ptr; - using Aliases = std::unordered_map; } diff --git a/dbms/src/Interpreters/Context.h b/dbms/src/Interpreters/Context.h index 8b4e66094fff162a7db2cf10e0af8cd084bdd103..4f90a50e349c09c26646fd9114ac102887b98487 100644 --- a/dbms/src/Interpreters/Context.h +++ b/dbms/src/Interpreters/Context.h @@ -1,23 +1,24 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include #include #include #include #include #include -#include -#include #include - -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include namespace Poco @@ -68,8 +69,6 @@ class IStorage; class ITableFunction; using StoragePtr = std::shared_ptr; using Tables = std::map; -class IAST; -using ASTPtr = std::shared_ptr; class IBlockInputStream; class IBlockOutputStream; using BlockInputStreamPtr = std::shared_ptr; diff --git a/dbms/src/Interpreters/DatabaseAndTableWithAlias.h b/dbms/src/Interpreters/DatabaseAndTableWithAlias.h index 0f1cbe8bbc7eaccb5ced97aabcd67016207f2748..22b03a5ed4464e95d6218d60f562981387164312 100644 --- a/dbms/src/Interpreters/DatabaseAndTableWithAlias.h +++ b/dbms/src/Interpreters/DatabaseAndTableWithAlias.h @@ -1,18 +1,16 @@ #pragma once +#include +#include +#include + #include #include -#include -#include - namespace DB { -class IAST; -using ASTPtr = std::shared_ptr; - class ASTSelectQuery; class ASTIdentifier; struct ASTTableExpression; diff --git a/dbms/src/Interpreters/ExpressionAnalyzer.h b/dbms/src/Interpreters/ExpressionAnalyzer.h index c7441efe4cb2b5d384ecbf774545468f8b12aacf..b9ec5c3ca70fda3c4953e72f527267841597317d 100644 --- a/dbms/src/Interpreters/ExpressionAnalyzer.h +++ b/dbms/src/Interpreters/ExpressionAnalyzer.h @@ -1,9 +1,11 @@ #pragma once +#include #include #include -#include #include +#include + namespace DB { @@ -15,9 +17,6 @@ struct ExpressionActionsChain; class ExpressionActions; using ExpressionActionsPtr = std::shared_ptr; -class IAST; -using ASTPtr = std::shared_ptr; -using ASTs = std::vector; struct ASTTableJoin; class IBlockInputStream; diff --git a/dbms/src/Interpreters/InterpreterAlterQuery.h b/dbms/src/Interpreters/InterpreterAlterQuery.h index bd9f3a89d6a8f43189ae8f65e264a15c9b2c32b2..776409a225d345c90e059349537d296b5fd1a694 100644 --- a/dbms/src/Interpreters/InterpreterAlterQuery.h +++ b/dbms/src/Interpreters/InterpreterAlterQuery.h @@ -1,14 +1,13 @@ #pragma once #include +#include namespace DB { class Context; -class IAST; -using ASTPtr = std::shared_ptr; /** Allows you add or remove a column in the table. * It also allows you to manipulate the partitions of the MergeTree family tables. diff --git a/dbms/src/Interpreters/InterpreterDescribeQuery.h b/dbms/src/Interpreters/InterpreterDescribeQuery.h index fc0bea10f2d5617e46a716e955a8c8ba5c78c891..4fafe61f229ab2f55309d62bf984baf36d35a390 100644 --- a/dbms/src/Interpreters/InterpreterDescribeQuery.h +++ b/dbms/src/Interpreters/InterpreterDescribeQuery.h @@ -1,14 +1,13 @@ #pragma once #include +#include namespace DB { class Context; -class IAST; -using ASTPtr = std::shared_ptr; /** Return names, types and other information about columns in specified table. diff --git a/dbms/src/Interpreters/InterpreterDropQuery.h b/dbms/src/Interpreters/InterpreterDropQuery.h index 2bea9f85c9995727f56d47d95885fd36bb3704da..1493d262a23a99acc7559aa37ae29b2c1334b6bc 100644 --- a/dbms/src/Interpreters/InterpreterDropQuery.h +++ b/dbms/src/Interpreters/InterpreterDropQuery.h @@ -1,16 +1,14 @@ #pragma once +#include #include #include -#include - +#include namespace DB { class Context; -class IAST; -using ASTPtr = std::shared_ptr; using DatabaseAndTable = std::pair; /** Allow to either drop table with all its data (DROP), diff --git a/dbms/src/Interpreters/InterpreterExistsQuery.h b/dbms/src/Interpreters/InterpreterExistsQuery.h index b2050b443d85960e251516ba8c56cd05d02a5456..1860e1d0aa973a6e549f990f03fcc98ffd29868a 100644 --- a/dbms/src/Interpreters/InterpreterExistsQuery.h +++ b/dbms/src/Interpreters/InterpreterExistsQuery.h @@ -1,14 +1,13 @@ #pragma once #include +#include namespace DB { class Context; -class IAST; -using ASTPtr = std::shared_ptr; /** Check that table exists. Return single row with single column "result" of type UInt8 and value 0 or 1. diff --git a/dbms/src/Interpreters/InterpreterExplainQuery.h b/dbms/src/Interpreters/InterpreterExplainQuery.h index 4db796ad0141b35f68c8280f2aae85bbba3b2b66..0d3b183857b90735d44a2f370a45890d97e91e4e 100644 --- a/dbms/src/Interpreters/InterpreterExplainQuery.h +++ b/dbms/src/Interpreters/InterpreterExplainQuery.h @@ -2,15 +2,12 @@ #include #include +#include namespace DB { -class IAST; -using ASTPtr = std::shared_ptr; - - /// Returns single row with explain results class InterpreterExplainQuery : public IInterpreter { diff --git a/dbms/src/Interpreters/InterpreterFactory.h b/dbms/src/Interpreters/InterpreterFactory.h index 25bad6659d579f7564263b55b0c517eb459ebba0..1f065bbf69bb33d794a5e67efa5d69e2e8524766 100644 --- a/dbms/src/Interpreters/InterpreterFactory.h +++ b/dbms/src/Interpreters/InterpreterFactory.h @@ -2,14 +2,13 @@ #include #include +#include namespace DB { class Context; -class IAST; -using ASTPtr = std::shared_ptr; class InterpreterFactory diff --git a/dbms/src/Interpreters/InterpreterKillQueryQuery.h b/dbms/src/Interpreters/InterpreterKillQueryQuery.h index 9294e45eab8ef253b65f65a99a656569afb7d56d..fab4b304865e8bf32f0542908a278f8264574b06 100644 --- a/dbms/src/Interpreters/InterpreterKillQueryQuery.h +++ b/dbms/src/Interpreters/InterpreterKillQueryQuery.h @@ -1,14 +1,13 @@ #pragma once #include +#include namespace DB { class Context; -class IAST; -using ASTPtr = std::shared_ptr; class InterpreterKillQueryQuery : public IInterpreter @@ -28,4 +27,3 @@ private: } - diff --git a/dbms/src/Interpreters/InterpreterOptimizeQuery.h b/dbms/src/Interpreters/InterpreterOptimizeQuery.h index 03c369b0e4a98a7c69e0cefc792fe69597904d23..251d8ea02f3e54cacdee6477e1518f818a5a93ce 100644 --- a/dbms/src/Interpreters/InterpreterOptimizeQuery.h +++ b/dbms/src/Interpreters/InterpreterOptimizeQuery.h @@ -1,14 +1,13 @@ #pragma once #include +#include namespace DB { class Context; -class IAST; -using ASTPtr = std::shared_ptr; /** Just call method "optimize" for table. diff --git a/dbms/src/Interpreters/InterpreterRenameQuery.h b/dbms/src/Interpreters/InterpreterRenameQuery.h index e9a36277ef0b49cdb0c187f8ce54474a4fcecb54..0433c638468bb871ab7b29c465e79fe2e34bc900 100644 --- a/dbms/src/Interpreters/InterpreterRenameQuery.h +++ b/dbms/src/Interpreters/InterpreterRenameQuery.h @@ -1,14 +1,13 @@ #pragma once #include +#include namespace DB { class Context; -class IAST; -using ASTPtr = std::shared_ptr; /** Rename one table diff --git a/dbms/src/Interpreters/InterpreterSelectQuery.cpp b/dbms/src/Interpreters/InterpreterSelectQuery.cpp index 44b8f85a93236f4499e0cddeb8f68390eea8a8dd..70c256198895f04a54ae37ae72c1e5cb6ac93b1b 100644 --- a/dbms/src/Interpreters/InterpreterSelectQuery.cpp +++ b/dbms/src/Interpreters/InterpreterSelectQuery.cpp @@ -1078,7 +1078,8 @@ void InterpreterSelectQuery::executeFetchColumns( void InterpreterSelectQuery::executeWhere(Pipeline & pipeline, const ExpressionActionsPtr & expression, bool remove_fiter) { - pipeline.transform([&](auto & stream) { + pipeline.transform([&](auto & stream) + { stream = std::make_shared( stream, expression, query_ptr->as()->where_expression->getColumnName(), remove_fiter); }); @@ -1206,7 +1207,8 @@ void InterpreterSelectQuery::executeMergeAggregated(Pipeline & pipeline, bool ov void InterpreterSelectQuery::executeHaving(Pipeline & pipeline, const ExpressionActionsPtr & expression) { - pipeline.transform([&](auto & stream) { + pipeline.transform([&](auto & stream) + { stream = std::make_shared( stream, expression, query_ptr->as()->having_expression->getColumnName()); }); diff --git a/dbms/src/Interpreters/InterpreterSetQuery.h b/dbms/src/Interpreters/InterpreterSetQuery.h index 7dbd444f6f115c063a3053b1e3439215f9e71cec..434765cf7d0a433ef455a0520cd668af05185f3a 100644 --- a/dbms/src/Interpreters/InterpreterSetQuery.h +++ b/dbms/src/Interpreters/InterpreterSetQuery.h @@ -1,15 +1,14 @@ #pragma once #include +#include namespace DB { class Context; -class IAST; class ASTSetQuery; -using ASTPtr = std::shared_ptr; /** Change one or several settings for the session or just for the current context. diff --git a/dbms/src/Interpreters/InterpreterShowCreateQuery.h b/dbms/src/Interpreters/InterpreterShowCreateQuery.h index 5e8672c17678e37fd984c79034d091e6af3bfb23..5ac98509b23496419d08b2fb05a201d7975ca8ee 100644 --- a/dbms/src/Interpreters/InterpreterShowCreateQuery.h +++ b/dbms/src/Interpreters/InterpreterShowCreateQuery.h @@ -1,14 +1,13 @@ #pragma once #include +#include namespace DB { class Context; -class IAST; -using ASTPtr = std::shared_ptr; /** Return single row with single column "statement" of type String with text of query to CREATE specified table. diff --git a/dbms/src/Interpreters/InterpreterShowProcesslistQuery.h b/dbms/src/Interpreters/InterpreterShowProcesslistQuery.h index ee180e766994e67f355df561deff194e6245ea90..6b87fd7edc330f0323ec0fba31e331b2e2e3adc9 100644 --- a/dbms/src/Interpreters/InterpreterShowProcesslistQuery.h +++ b/dbms/src/Interpreters/InterpreterShowProcesslistQuery.h @@ -1,14 +1,13 @@ #pragma once #include +#include namespace DB { class Context; -class IAST; -using ASTPtr = std::shared_ptr; /** Return list of currently executing queries. diff --git a/dbms/src/Interpreters/InterpreterShowTablesQuery.h b/dbms/src/Interpreters/InterpreterShowTablesQuery.h index 3f661da3e2d10506047cab36014edc4cd38949bf..fc5cb2b7505e012efef6723248cfdc361ca6a959 100644 --- a/dbms/src/Interpreters/InterpreterShowTablesQuery.h +++ b/dbms/src/Interpreters/InterpreterShowTablesQuery.h @@ -1,14 +1,13 @@ #pragma once #include +#include namespace DB { class Context; -class IAST; -using ASTPtr = std::shared_ptr; /** Return a list of tables or databases meets specified conditions. diff --git a/dbms/src/Interpreters/InterpreterSystemQuery.h b/dbms/src/Interpreters/InterpreterSystemQuery.h index fb92e7997616f34ff8264bf6dc59f27faa4e8fad..65aaf7894190c81c79809315d48f53c9211aefaa 100644 --- a/dbms/src/Interpreters/InterpreterSystemQuery.h +++ b/dbms/src/Interpreters/InterpreterSystemQuery.h @@ -1,15 +1,15 @@ #pragma once + #include +#include namespace DB { class Context; -class IAST; class ASTSystemQuery; class IStorage; -using ASTPtr = std::shared_ptr; using StoragePtr = std::shared_ptr; diff --git a/dbms/src/Interpreters/InterpreterUseQuery.h b/dbms/src/Interpreters/InterpreterUseQuery.h index 988ccb741fae2e8525bcb6a7a8a5cc737010b52f..ae409117afd29540d09735d77392daa8dd4ffc60 100644 --- a/dbms/src/Interpreters/InterpreterUseQuery.h +++ b/dbms/src/Interpreters/InterpreterUseQuery.h @@ -1,14 +1,13 @@ #pragma once #include +#include namespace DB { class Context; -class IAST; -using ASTPtr = std::shared_ptr; /** Change default database for session. diff --git a/dbms/src/Storages/StorageMaterializedView.h b/dbms/src/Storages/StorageMaterializedView.h index 8c2657b484bb69d17b067c036c8c9c1d3a52b4b6..665f6243a32c93a37c4eeee8fe8c21a176f5371a 100644 --- a/dbms/src/Storages/StorageMaterializedView.h +++ b/dbms/src/Storages/StorageMaterializedView.h @@ -2,16 +2,13 @@ #include +#include #include namespace DB { -class IAST; // XXX: should include full class - for proper use inside inline methods -using ASTPtr = std::shared_ptr; - - class StorageMaterializedView : public ext::shared_ptr_helper, public IStorage { public: diff --git a/dbms/src/Storages/StorageView.h b/dbms/src/Storages/StorageView.h index fed6664b8eb51327fef4e29cb5d03ad862d065d9..afd9b5ce326c76580bf91c6430b9d34a0beb9f5c 100644 --- a/dbms/src/Storages/StorageView.h +++ b/dbms/src/Storages/StorageView.h @@ -1,17 +1,15 @@ #pragma once -#include -#include #include +#include +#include + +#include namespace DB { -class IAST; -using ASTPtr = std::shared_ptr; - - class StorageView : public ext::shared_ptr_helper, public IStorage { public: diff --git a/dbms/src/TableFunctions/ITableFunction.h b/dbms/src/TableFunctions/ITableFunction.h index ddf900fa65cf9cca04ce56e21556167692b1db90..39ef7857a3ab4534f810b196aef36bc6f5d745e9 100644 --- a/dbms/src/TableFunctions/ITableFunction.h +++ b/dbms/src/TableFunctions/ITableFunction.h @@ -1,14 +1,15 @@ #pragma once +#include + #include #include + namespace DB { class Context; -class IAST; -using ASTPtr = std::shared_ptr; class IStorage; using StoragePtr = std::shared_ptr;