diff --git a/src/Access/ya.make b/src/Access/ya.make index 59fb504c6ab..5f2f410cabd 100644 --- a/src/Access/ya.make +++ b/src/Access/ya.make @@ -43,6 +43,7 @@ SRCS( SettingsProfile.cpp SettingsProfileElement.cpp SettingsProfilesCache.cpp + SettingsProfilesInfo.cpp User.cpp UsersConfigAccessStorage.cpp tests/gtest_access_rights_ops.cpp diff --git a/src/Client/ya.make b/src/Client/ya.make index 4201203a8e9..88fa14ad377 100644 --- a/src/Client/ya.make +++ b/src/Client/ya.make @@ -12,9 +12,11 @@ PEERDIR( SRCS( Connection.cpp ConnectionEstablisher.cpp + ConnectionPool.cpp ConnectionPoolWithFailover.cpp HedgedConnections.cpp HedgedConnectionsFactory.cpp + IConnections.cpp MultiplexedConnections.cpp ) diff --git a/src/DataStreams/PushingToSinkBlockOutputStream.h b/src/DataStreams/PushingToSinkBlockOutputStream.h index 3cbeac636b2..eeca8506d8e 100644 --- a/src/DataStreams/PushingToSinkBlockOutputStream.h +++ b/src/DataStreams/PushingToSinkBlockOutputStream.h @@ -5,6 +5,11 @@ namespace DB { +namespace ErrorCodes +{ + extern const int LOGICAL_ERROR; +} + class PushingToSinkBlockOutputStream : public IBlockOutputStream { public: diff --git a/src/DataStreams/PushingToViewsBlockOutputStream.cpp b/src/DataStreams/PushingToViewsBlockOutputStream.cpp index 627dd2bc50d..a4e35cc1dd3 100644 --- a/src/DataStreams/PushingToViewsBlockOutputStream.cpp +++ b/src/DataStreams/PushingToViewsBlockOutputStream.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/DataStreams/ya.make b/src/DataStreams/ya.make index c609483d653..2012af76697 100644 --- a/src/DataStreams/ya.make +++ b/src/DataStreams/ya.make @@ -19,6 +19,7 @@ SRCS( BlockStreamProfileInfo.cpp CheckConstraintsBlockOutputStream.cpp ColumnGathererStream.cpp + ConnectionCollector.cpp ConvertingBlockInputStream.cpp CountingBlockOutputStream.cpp DistinctSortedBlockInputStream.cpp diff --git a/src/Functions/ya.make b/src/Functions/ya.make index aa8ca3d9b8f..d1def6ad90e 100644 --- a/src/Functions/ya.make +++ b/src/Functions/ya.make @@ -232,6 +232,8 @@ SRCS( countSubstringsCaseInsensitive.cpp countSubstringsCaseInsensitiveUTF8.cpp currentDatabase.cpp + currentProfiles.cpp + currentRoles.cpp currentUser.cpp dateDiff.cpp dateName.cpp @@ -319,6 +321,7 @@ SRCS( ilike.cpp in.cpp indexHint.cpp + initialQueryID.cpp initializeAggregation.cpp intDiv.cpp intDivOrZero.cpp @@ -412,6 +415,7 @@ SRCS( positionCaseInsensitiveUTF8.cpp positionUTF8.cpp pow.cpp + queryID.cpp rand.cpp rand64.cpp randConstant.cpp diff --git a/src/IO/ya.make b/src/IO/ya.make index 3bd704ec6f0..0023c6d7dfe 100644 --- a/src/IO/ya.make +++ b/src/IO/ya.make @@ -43,6 +43,7 @@ SRCS( MySQLPacketPayloadReadBuffer.cpp MySQLPacketPayloadWriteBuffer.cpp NullWriteBuffer.cpp + OpenedFile.cpp PeekableReadBuffer.cpp Progress.cpp ReadBufferFromEncryptedFile.cpp diff --git a/src/Processors/QueryPlan/ReadFromMergeTree.cpp b/src/Processors/QueryPlan/ReadFromMergeTree.cpp index 2983663d0ce..d633c669e07 100644 --- a/src/Processors/QueryPlan/ReadFromMergeTree.cpp +++ b/src/Processors/QueryPlan/ReadFromMergeTree.cpp @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include @@ -157,7 +157,7 @@ Pipe ReadFromMergeTree::readFromPool( for (size_t i = 0; i < max_streams; ++i) { - auto source = std::make_shared( + auto source = std::make_shared( i, pool, min_marks_for_concurrent_read, max_block_size, settings.preferred_block_size_bytes, settings.preferred_max_column_in_block_size_bytes, data, metadata_snapshot, use_uncompressed_cache, @@ -662,7 +662,7 @@ Pipe ReadFromMergeTree::spreadMarkRangesAmongStreamsFinal( /// If do_not_merge_across_partitions_select_final is true and there is only one part in partition /// with level > 0 then we won't postprocess this part and if num_streams > 1 we /// can use parallel select on such parts. We save such parts in one vector and then use - /// MergeTreeReadPool and MergeTreeThreadSelectBlockInputProcessor for parallel select. + /// MergeTreeReadPool and MergeTreeThreadSelectProcessor for parallel select. if (num_streams > 1 && settings.do_not_merge_across_partitions_select_final && std::distance(parts_to_merge_ranges[range_index], parts_to_merge_ranges[range_index + 1]) == 1 && parts_to_merge_ranges[range_index]->data_part->info.level > 0) diff --git a/src/Processors/Sinks/SinkToStorage.h b/src/Processors/Sinks/SinkToStorage.h index 41870ed5ad7..c57adef568f 100644 --- a/src/Processors/Sinks/SinkToStorage.h +++ b/src/Processors/Sinks/SinkToStorage.h @@ -5,7 +5,8 @@ namespace DB { -/// Sink which reads everything and do nothing with it. +/// Sink which is returned from Storage::read. +/// The same as ISink, but also can hold table lock. class SinkToStorage : public ISink { public: diff --git a/src/Storages/Distributed/DistributedBlockOutputStream.cpp b/src/Storages/Distributed/DistributedSink.cpp similarity index 99% rename from src/Storages/Distributed/DistributedBlockOutputStream.cpp rename to src/Storages/Distributed/DistributedSink.cpp index 03828fa7566..ec3f82d914c 100644 --- a/src/Storages/Distributed/DistributedBlockOutputStream.cpp +++ b/src/Storages/Distributed/DistributedSink.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/src/Storages/Distributed/DistributedBlockOutputStream.h b/src/Storages/Distributed/DistributedSink.h similarity index 100% rename from src/Storages/Distributed/DistributedBlockOutputStream.h rename to src/Storages/Distributed/DistributedSink.h diff --git a/src/Storages/MergeTree/MergeTreeReverseSelectProcessor.h b/src/Storages/MergeTree/MergeTreeReverseSelectProcessor.h index 4a6bd0c5577..a76564302a4 100644 --- a/src/Storages/MergeTree/MergeTreeReverseSelectProcessor.h +++ b/src/Storages/MergeTree/MergeTreeReverseSelectProcessor.h @@ -1,6 +1,6 @@ #pragma once -#include +#include #include #include #include diff --git a/src/Storages/MergeTree/MergeTreeSelectProcessor.h b/src/Storages/MergeTree/MergeTreeSelectProcessor.h index 05efd4bc342..e9712bd5ade 100644 --- a/src/Storages/MergeTree/MergeTreeSelectProcessor.h +++ b/src/Storages/MergeTree/MergeTreeSelectProcessor.h @@ -1,5 +1,5 @@ #pragma once -#include +#include #include #include #include diff --git a/src/Storages/MergeTree/MergeTreeBlockOutputStream.cpp b/src/Storages/MergeTree/MergeTreeSink.cpp similarity index 96% rename from src/Storages/MergeTree/MergeTreeBlockOutputStream.cpp rename to src/Storages/MergeTree/MergeTreeSink.cpp index d1d3686aa55..73c753386a4 100644 --- a/src/Storages/MergeTree/MergeTreeBlockOutputStream.cpp +++ b/src/Storages/MergeTree/MergeTreeSink.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/src/Storages/MergeTree/MergeTreeBlockOutputStream.h b/src/Storages/MergeTree/MergeTreeSink.h similarity index 100% rename from src/Storages/MergeTree/MergeTreeBlockOutputStream.h rename to src/Storages/MergeTree/MergeTreeSink.h diff --git a/src/Storages/MergeTree/MergeTreeThreadSelectBlockInputProcessor.cpp b/src/Storages/MergeTree/MergeTreeThreadSelectProcessor.cpp similarity index 93% rename from src/Storages/MergeTree/MergeTreeThreadSelectBlockInputProcessor.cpp rename to src/Storages/MergeTree/MergeTreeThreadSelectProcessor.cpp index daefb17038a..4eb6bc4b2e2 100644 --- a/src/Storages/MergeTree/MergeTreeThreadSelectBlockInputProcessor.cpp +++ b/src/Storages/MergeTree/MergeTreeThreadSelectProcessor.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include @@ -8,7 +8,7 @@ namespace DB { -MergeTreeThreadSelectBlockInputProcessor::MergeTreeThreadSelectBlockInputProcessor( +MergeTreeThreadSelectProcessor::MergeTreeThreadSelectProcessor( const size_t thread_, const MergeTreeReadPoolPtr & pool_, const size_t min_marks_to_read_, @@ -46,7 +46,7 @@ MergeTreeThreadSelectBlockInputProcessor::MergeTreeThreadSelectBlockInputProcess } /// Requests read task from MergeTreeReadPool and signals whether it got one -bool MergeTreeThreadSelectBlockInputProcessor::getNewTask() +bool MergeTreeThreadSelectProcessor::getNewTask() { task = pool->getTask(min_marks_to_read, thread, ordered_names); @@ -107,6 +107,6 @@ bool MergeTreeThreadSelectBlockInputProcessor::getNewTask() } -MergeTreeThreadSelectBlockInputProcessor::~MergeTreeThreadSelectBlockInputProcessor() = default; +MergeTreeThreadSelectProcessor::~MergeTreeThreadSelectProcessor() = default; } diff --git a/src/Storages/MergeTree/MergeTreeThreadSelectBlockInputProcessor.h b/src/Storages/MergeTree/MergeTreeThreadSelectProcessor.h similarity index 88% rename from src/Storages/MergeTree/MergeTreeThreadSelectBlockInputProcessor.h rename to src/Storages/MergeTree/MergeTreeThreadSelectProcessor.h index 30c551eede0..d17b15c3635 100644 --- a/src/Storages/MergeTree/MergeTreeThreadSelectBlockInputProcessor.h +++ b/src/Storages/MergeTree/MergeTreeThreadSelectProcessor.h @@ -11,10 +11,10 @@ class MergeTreeReadPool; /** Used in conjunction with MergeTreeReadPool, asking it for more work to do and performing whatever reads it is asked * to perform. */ -class MergeTreeThreadSelectBlockInputProcessor : public MergeTreeBaseSelectProcessor +class MergeTreeThreadSelectProcessor : public MergeTreeBaseSelectProcessor { public: - MergeTreeThreadSelectBlockInputProcessor( + MergeTreeThreadSelectProcessor( const size_t thread_, const std::shared_ptr & pool_, const size_t min_marks_to_read_, @@ -32,7 +32,7 @@ public: String getName() const override { return "MergeTreeThread"; } - ~MergeTreeThreadSelectBlockInputProcessor() override; + ~MergeTreeThreadSelectProcessor() override; protected: /// Requests read task from MergeTreeReadPool and signals whether it got one diff --git a/src/Storages/MergeTree/ReplicatedMergeTreeBlockOutputStream.cpp b/src/Storages/MergeTree/ReplicatedMergeTreeSink.cpp similarity index 99% rename from src/Storages/MergeTree/ReplicatedMergeTreeBlockOutputStream.cpp rename to src/Storages/MergeTree/ReplicatedMergeTreeSink.cpp index c65da2be0aa..c81f587cbbc 100644 --- a/src/Storages/MergeTree/ReplicatedMergeTreeBlockOutputStream.cpp +++ b/src/Storages/MergeTree/ReplicatedMergeTreeSink.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include #include diff --git a/src/Storages/MergeTree/ReplicatedMergeTreeBlockOutputStream.h b/src/Storages/MergeTree/ReplicatedMergeTreeSink.h similarity index 100% rename from src/Storages/MergeTree/ReplicatedMergeTreeBlockOutputStream.h rename to src/Storages/MergeTree/ReplicatedMergeTreeSink.h diff --git a/src/Storages/RabbitMQ/RabbitMQBlockOutputStream.cpp b/src/Storages/RabbitMQ/RabbitMQSink.cpp similarity index 95% rename from src/Storages/RabbitMQ/RabbitMQBlockOutputStream.cpp rename to src/Storages/RabbitMQ/RabbitMQSink.cpp index a5f2fc83209..00f1754ce8a 100644 --- a/src/Storages/RabbitMQ/RabbitMQBlockOutputStream.cpp +++ b/src/Storages/RabbitMQ/RabbitMQSink.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/src/Storages/RabbitMQ/RabbitMQBlockOutputStream.h b/src/Storages/RabbitMQ/RabbitMQSink.h similarity index 100% rename from src/Storages/RabbitMQ/RabbitMQBlockOutputStream.h rename to src/Storages/RabbitMQ/RabbitMQSink.h diff --git a/src/Storages/RabbitMQ/StorageRabbitMQ.cpp b/src/Storages/RabbitMQ/StorageRabbitMQ.cpp index 4c4ca1b42f6..44622f106f4 100644 --- a/src/Storages/RabbitMQ/StorageRabbitMQ.cpp +++ b/src/Storages/RabbitMQ/StorageRabbitMQ.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/Storages/RocksDB/EmbeddedRocksDBBlockOutputStream.cpp b/src/Storages/RocksDB/EmbeddedRocksDBSink.cpp similarity index 96% rename from src/Storages/RocksDB/EmbeddedRocksDBBlockOutputStream.cpp rename to src/Storages/RocksDB/EmbeddedRocksDBSink.cpp index 71a1c945c9f..ddf839b6427 100644 --- a/src/Storages/RocksDB/EmbeddedRocksDBBlockOutputStream.cpp +++ b/src/Storages/RocksDB/EmbeddedRocksDBSink.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/src/Storages/RocksDB/EmbeddedRocksDBBlockOutputStream.h b/src/Storages/RocksDB/EmbeddedRocksDBSink.h similarity index 100% rename from src/Storages/RocksDB/EmbeddedRocksDBBlockOutputStream.h rename to src/Storages/RocksDB/EmbeddedRocksDBSink.h diff --git a/src/Storages/RocksDB/StorageEmbeddedRocksDB.cpp b/src/Storages/RocksDB/StorageEmbeddedRocksDB.cpp index 3b7fa285086..8df9f77e5ea 100644 --- a/src/Storages/RocksDB/StorageEmbeddedRocksDB.cpp +++ b/src/Storages/RocksDB/StorageEmbeddedRocksDB.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include diff --git a/src/Storages/StorageDistributed.cpp b/src/Storages/StorageDistributed.cpp index a0f95db111c..5173abeb9f9 100644 --- a/src/Storages/StorageDistributed.cpp +++ b/src/Storages/StorageDistributed.cpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include diff --git a/src/Storages/StorageMergeTree.cpp b/src/Storages/StorageMergeTree.cpp index 5bd760c9abc..4f0046eecba 100644 --- a/src/Storages/StorageMergeTree.cpp +++ b/src/Storages/StorageMergeTree.cpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/Storages/StorageReplicatedMergeTree.cpp b/src/Storages/StorageReplicatedMergeTree.cpp index 515e6ca2f0e..4fa16bd79ce 100644 --- a/src/Storages/StorageReplicatedMergeTree.cpp +++ b/src/Storages/StorageReplicatedMergeTree.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/Storages/ya.make b/src/Storages/ya.make index c001d933558..89f881c550f 100644 --- a/src/Storages/ya.make +++ b/src/Storages/ya.make @@ -16,8 +16,8 @@ SRCS( ColumnsDescription.cpp ConstraintsDescription.cpp Distributed/DirectoryMonitor.cpp - Distributed/DistributedBlockOutputStream.cpp Distributed/DistributedSettings.cpp + Distributed/DistributedSink.cpp IStorage.cpp IndicesDescription.cpp JoinSettings.cpp @@ -41,7 +41,6 @@ SRCS( MergeTree/MergeAlgorithm.cpp MergeTree/MergeList.cpp MergeTree/MergeTreeBaseSelectProcessor.cpp - MergeTree/MergeTreeBlockOutputStream.cpp MergeTree/MergeTreeBlockReadUtils.cpp MergeTree/MergeTreeData.cpp MergeTree/MergeTreeDataMergerMutator.cpp @@ -87,7 +86,8 @@ SRCS( MergeTree/MergeTreeSelectProcessor.cpp MergeTree/MergeTreeSequentialSource.cpp MergeTree/MergeTreeSettings.cpp - MergeTree/MergeTreeThreadSelectBlockInputProcessor.cpp + MergeTree/MergeTreeSink.cpp + MergeTree/MergeTreeThreadSelectProcessor.cpp MergeTree/MergeTreeWhereOptimizer.cpp MergeTree/MergeTreeWriteAheadLog.cpp MergeTree/MergeType.cpp @@ -99,7 +99,6 @@ SRCS( MergeTree/ReplicatedFetchList.cpp MergeTree/ReplicatedMergeTreeAddress.cpp MergeTree/ReplicatedMergeTreeAltersSequence.cpp - MergeTree/ReplicatedMergeTreeBlockOutputStream.cpp MergeTree/ReplicatedMergeTreeCleanupThread.cpp MergeTree/ReplicatedMergeTreeLogEntry.cpp MergeTree/ReplicatedMergeTreeMergeStrategyPicker.cpp @@ -108,6 +107,7 @@ SRCS( MergeTree/ReplicatedMergeTreePartHeader.cpp MergeTree/ReplicatedMergeTreeQueue.cpp MergeTree/ReplicatedMergeTreeRestartingThread.cpp + MergeTree/ReplicatedMergeTreeSink.cpp MergeTree/ReplicatedMergeTreeTableMetadata.cpp MergeTree/SimpleMergeSelector.cpp MergeTree/TTLMergeSelector.cpp