text
stringlengths
19
585k
label
stringclasses
2 values
category
stringclasses
2 values
language
stringclasses
14 values
repo
stringclasses
932 values
sha
stringlengths
40
40
@@ -543,13 +543,14 @@ class JobConfigs: # --root/--privileged/--cgroupns=host is required for clickhouse-test --memory-limit bugfix_validation_ft_pr_job = Job.Config( name=JobNames.BUGFIX_VALIDATE_FT, - runs_on=RunnerLabels.FUNC_TESTER_ARM, + runs_on=RunnerLabels.FUNC_TESTER_AMD, ...
bad
review
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/defs/job_configs.py b/ci/defs/job_configs.py index 8fdfe5f1838d..f63e5e7db667 100644 --- a/ci/defs/job_configs.py +++ b/ci/defs/job_configs.py @@ -543,13 +543,16 @@ class JobConfigs: # --root/--privileged/--cgroupns=host is required for clickhouse-test --memory-limit bugfix_validation_ft_pr_jo...
good
review_fixed
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
@@ -23,13 +23,18 @@ digest = Digest().calc_job_digest(some_build_job, {}, {}).split("-")[0] info.store_kv_data("build_digest", digest) - if info.git_branch == "master" and info.repo_name == "ClickHouse/ClickHouse": - # store previous commits for perf tests + # store recent master commits (used ...
bad
review
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/scripts/workflow_hooks/store_data.py b/ci/jobs/scripts/workflow_hooks/store_data.py index 1a31f9d1de0a..e75db148566e 100644 --- a/ci/jobs/scripts/workflow_hooks/store_data.py +++ b/ci/jobs/scripts/workflow_hooks/store_data.py @@ -23,13 +23,20 @@ digest = Digest().calc_job_digest(some_build_job...
good
review_fixed
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
@@ -1104,21 +1176,36 @@ def main(): assert ( is_llvm_coverage is False ), "Bugfix validation with LLVM coverage is not supported" - has_failure = False - for r in R.results: - # invert statuses - r.set_label(Result.Label.XFAIL) - if r.status ...
bad
review
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/integration_test_job.py b/ci/jobs/integration_test_job.py index e10e26c92b5f..1afe89c6a602 100644 --- a/ci/jobs/integration_test_job.py +++ b/ci/jobs/integration_test_job.py @@ -8,6 +8,7 @@ from more_itertools import tail +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_...
good
review_fixed
python
ClickHouse/ClickHouse
75f70593f94f80f92b7be4250fa0de20ce47d032
@@ -3676,13 +3676,18 @@ IUserDefinedSQLObjectsStorage & Context::getUserDefinedSQLObjectsStorage() return *shared->user_defined_sql_objects_storage; } -IWorkloadEntityStorage & Context::getWorkloadEntityStorage() const +std::shared_ptr<IWorkloadEntityStorage> Context::getWorkloadEntityStoragePtr() const { ...
bad
review
cpp
ClickHouse/ClickHouse
6278ace9a4a73d81694b62bd3322d323915a76db
diff --git a/src/Interpreters/Context.cpp b/src/Interpreters/Context.cpp index 99bfc66be017..9f22039155e1 100644 --- a/src/Interpreters/Context.cpp +++ b/src/Interpreters/Context.cpp @@ -517,7 +517,7 @@ struct ContextSharedPart : boost::noncopyable mutable std::unique_ptr<IUserDefinedSQLObjectsStorage> user_define...
good
review_fixed
cpp
ClickHouse/ClickHouse
6278ace9a4a73d81694b62bd3322d323915a76db
@@ -3676,13 +3676,21 @@ IUserDefinedSQLObjectsStorage & Context::getUserDefinedSQLObjectsStorage() return *shared->user_defined_sql_objects_storage; } -IWorkloadEntityStorage & Context::getWorkloadEntityStorage() const +std::shared_ptr<IWorkloadEntityStorage> Context::getWorkloadEntityStoragePtr() const { ...
bad
review
cpp
ClickHouse/ClickHouse
6278ace9a4a73d81694b62bd3322d323915a76db
diff --git a/src/Interpreters/Context.cpp b/src/Interpreters/Context.cpp index 99bfc66be017..9f22039155e1 100644 --- a/src/Interpreters/Context.cpp +++ b/src/Interpreters/Context.cpp @@ -517,7 +517,7 @@ struct ContextSharedPart : boost::noncopyable mutable std::unique_ptr<IUserDefinedSQLObjectsStorage> user_define...
good
review_fixed
cpp
ClickHouse/ClickHouse
6278ace9a4a73d81694b62bd3322d323915a76db
@@ -3676,13 +3676,21 @@ IUserDefinedSQLObjectsStorage & Context::getUserDefinedSQLObjectsStorage() return *shared->user_defined_sql_objects_storage; } -IWorkloadEntityStorage & Context::getWorkloadEntityStorage() const +std::shared_ptr<IWorkloadEntityStorage> Context::getWorkloadEntityStoragePtr() const { ...
bad
review
cpp
ClickHouse/ClickHouse
6278ace9a4a73d81694b62bd3322d323915a76db
diff --git a/src/Interpreters/Context.cpp b/src/Interpreters/Context.cpp index 99bfc66be017..9f22039155e1 100644 --- a/src/Interpreters/Context.cpp +++ b/src/Interpreters/Context.cpp @@ -517,7 +517,7 @@ struct ContextSharedPart : boost::noncopyable mutable std::unique_ptr<IUserDefinedSQLObjectsStorage> user_define...
good
review_fixed
cpp
ClickHouse/ClickHouse
6278ace9a4a73d81694b62bd3322d323915a76db
@@ -102,3 +102,19 @@ def test_writes_orc_format(started_cluster_iceberg_with_spark, format_version, s found_orc_files = True assert found_orc_files +@pytest.mark.parametrize("format_version", ["1", "2"]) +@pytest.mark.parametrize("storage_type", ["s3", "azure", "local"])
bad
review
python
ClickHouse/ClickHouse
71da38208bb3dfaa71aebe49febda8323d92a896
diff --git a/tests/integration/test_storage_iceberg_with_spark/test_writes.py b/tests/integration/test_storage_iceberg_with_spark/test_writes.py index f110430e8914..808ef7236097 100644 --- a/tests/integration/test_storage_iceberg_with_spark/test_writes.py +++ b/tests/integration/test_storage_iceberg_with_spark/test_wri...
good
review_fixed
python
ClickHouse/ClickHouse
71da38208bb3dfaa71aebe49febda8323d92a896
@@ -102,3 +102,19 @@ def test_writes_orc_format(started_cluster_iceberg_with_spark, format_version, s found_orc_files = True assert found_orc_files +@pytest.mark.parametrize("format_version", ["1", "2"]) +@pytest.mark.parametrize("storage_type", ["s3", "azure", "local"]) +def test_writes_detach_atta...
bad
review
python
ClickHouse/ClickHouse
71da38208bb3dfaa71aebe49febda8323d92a896
diff --git a/tests/integration/test_storage_iceberg_with_spark/test_writes.py b/tests/integration/test_storage_iceberg_with_spark/test_writes.py index f110430e8914..808ef7236097 100644 --- a/tests/integration/test_storage_iceberg_with_spark/test_writes.py +++ b/tests/integration/test_storage_iceberg_with_spark/test_wri...
good
review_fixed
python
ClickHouse/ClickHouse
71da38208bb3dfaa71aebe49febda8323d92a896
@@ -138,6 +138,15 @@ ColumnPtr FunctionArrayRemove::executeImpl( /// equals() on tuples with nullable components may return ColumnConst(Nullable(UInt8)). /// convertToFullIfNeeded() unwraps ColumnConst so removeNullable can strip the Nullable layer. auto else_col = removeNullable(equals_resul...
bad
review
cpp
ClickHouse/ClickHouse
1fcf1c2b16335305856abda4740eb3e2275f4b12
diff --git a/src/Functions/array/arrayRemove.cpp b/src/Functions/array/arrayRemove.cpp index d3901c993284..b43364630a0b 100644 --- a/src/Functions/array/arrayRemove.cpp +++ b/src/Functions/array/arrayRemove.cpp @@ -138,6 +138,17 @@ ColumnPtr FunctionArrayRemove::executeImpl( /// equals() on tuples with nullabl...
good
review_fixed
cpp
ClickHouse/ClickHouse
1fcf1c2b16335305856abda4740eb3e2275f4b12
@@ -95,6 +95,10 @@ class ResourceGuard // lock(mutex) is not required because `Finished` request cannot be used by the scheduler thread chassert(state == Finished); state = Enqueued; + // `Request` is reused (e.g. via `Request::local()` thread-local instance), so a stal...
bad
review
c
ClickHouse/ClickHouse
da47f28415c7460ae1d6385dd4fa20fedae1f0be
diff --git a/src/Common/Scheduler/ResourceGuard.h b/src/Common/Scheduler/ResourceGuard.h index 5d894b8b9ed5..402c3a782ce1 100644 --- a/src/Common/Scheduler/ResourceGuard.h +++ b/src/Common/Scheduler/ResourceGuard.h @@ -95,6 +95,10 @@ class ResourceGuard // lock(mutex) is not required because `Finished` req...
good
review_fixed
c
ClickHouse/ClickHouse
da47f28415c7460ae1d6385dd4fa20fedae1f0be
@@ -134,6 +138,22 @@ class ResourceGuard ProfileEvents::increment(metrics->cost, real_cost_); } + // Restore a reused request to the `Finished` state after a `ResourceGuard` constructor failed + // (either `enqueue()` or `wait()` threw). Because the constructor is unwinding, `~Reso...
bad
review
c
ClickHouse/ClickHouse
da47f28415c7460ae1d6385dd4fa20fedae1f0be
diff --git a/src/Common/Scheduler/ResourceGuard.h b/src/Common/Scheduler/ResourceGuard.h index 5d894b8b9ed5..402c3a782ce1 100644 --- a/src/Common/Scheduler/ResourceGuard.h +++ b/src/Common/Scheduler/ResourceGuard.h @@ -95,6 +95,10 @@ class ResourceGuard // lock(mutex) is not required because `Finished` req...
good
review_fixed
c
ClickHouse/ClickHouse
da47f28415c7460ae1d6385dd4fa20fedae1f0be
@@ -134,6 +138,23 @@ class ResourceGuard ProfileEvents::increment(metrics->cost, real_cost_); } + // Restore a reused request to the `Finished` state after a `ResourceGuard` constructor failed + // (either `enqueue()` or `wait()` threw). Because the constructor is unwinding, `~Reso...
bad
review
c
ClickHouse/ClickHouse
da47f28415c7460ae1d6385dd4fa20fedae1f0be
diff --git a/src/Common/Scheduler/ResourceGuard.h b/src/Common/Scheduler/ResourceGuard.h index 5d894b8b9ed5..402c3a782ce1 100644 --- a/src/Common/Scheduler/ResourceGuard.h +++ b/src/Common/Scheduler/ResourceGuard.h @@ -95,6 +95,10 @@ class ResourceGuard // lock(mutex) is not required because `Finished` req...
good
review_fixed
c
ClickHouse/ClickHouse
da47f28415c7460ae1d6385dd4fa20fedae1f0be
@@ -249,8 +249,14 @@ class CombinatorArgMinArgMax final : public IAggregateFunctionCombinator void registerAggregateFunctionCombinatorsArgMinArgMax(AggregateFunctionCombinatorFactory & factory) { - factory.registerCombinator(std::make_shared<CombinatorArgMinArgMax<true>>()); - factory.registerCombinator(std::...
bad
review
cpp
ClickHouse/ClickHouse
1cfb6342b4652f83cd4799547ffe64ec00dff9e1
diff --git a/src/AggregateFunctions/Combinators/AggregateFunctionCombinatorsArgMinArgMax.cpp b/src/AggregateFunctions/Combinators/AggregateFunctionCombinatorsArgMinArgMax.cpp index dd89576a71c1..f62c49b72ce4 100644 --- a/src/AggregateFunctions/Combinators/AggregateFunctionCombinatorsArgMinArgMax.cpp +++ b/src/Aggregate...
good
review_fixed
cpp
ClickHouse/ClickHouse
1cfb6342b4652f83cd4799547ffe64ec00dff9e1
@@ -99,7 +99,10 @@ class AggregateFunctionCombinatorResample final : public IAggregateFunctionCombi void registerAggregateFunctionCombinatorResample(AggregateFunctionCombinatorFactory & factory) { - factory.registerCombinator(std::make_shared<AggregateFunctionCombinatorResample>()); + factory.registerCombinat...
bad
review
cpp
ClickHouse/ClickHouse
1cfb6342b4652f83cd4799547ffe64ec00dff9e1
diff --git a/src/AggregateFunctions/Combinators/AggregateFunctionResample.cpp b/src/AggregateFunctions/Combinators/AggregateFunctionResample.cpp index 41652432331f..f74a4059a005 100644 --- a/src/AggregateFunctions/Combinators/AggregateFunctionResample.cpp +++ b/src/AggregateFunctions/Combinators/AggregateFunctionResamp...
good
review_fixed
cpp
ClickHouse/ClickHouse
1cfb6342b4652f83cd4799547ffe64ec00dff9e1
@@ -27,7 +27,10 @@ namespace void registerAggregateFunctionCombinatorSimpleState(AggregateFunctionCombinatorFactory & factory) { - factory.registerCombinator(std::make_shared<AggregateFunctionCombinatorSimpleState>()); + factory.registerCombinator(std::make_shared<AggregateFunctionCombinatorSimpleState>(), Do...
bad
review
cpp
ClickHouse/ClickHouse
1cfb6342b4652f83cd4799547ffe64ec00dff9e1
diff --git a/src/AggregateFunctions/Combinators/AggregateFunctionSimpleState.cpp b/src/AggregateFunctions/Combinators/AggregateFunctionSimpleState.cpp index c9c9ddcf8228..d9df7eef5b92 100644 --- a/src/AggregateFunctions/Combinators/AggregateFunctionSimpleState.cpp +++ b/src/AggregateFunctions/Combinators/AggregateFunct...
good
review_fixed
cpp
ClickHouse/ClickHouse
1cfb6342b4652f83cd4799547ffe64ec00dff9e1
@@ -0,0 +1,12 @@ +-- Aggregate function combinators expose embedded documentation via system.aggregate_function_combinators. + +-- User-facing combinators must have a non-empty description and syntax. +SELECT name, length(description) > 0 AS has_description, length(syntax) > 0 AS has_syntax +FROM system.aggregate_funct...
bad
review
ClickHouse/ClickHouse
1cfb6342b4652f83cd4799547ffe64ec00dff9e1
diff --git a/tests/queries/0_stateless/04305_aggregate_function_combinators_documentation.sql b/tests/queries/0_stateless/04305_aggregate_function_combinators_documentation.sql new file mode 100644 index 000000000000..f45409b495ac --- /dev/null +++ b/tests/queries/0_stateless/04305_aggregate_function_combinators_docume...
good
review_fixed
ClickHouse/ClickHouse
1cfb6342b4652f83cd4799547ffe64ec00dff9e1
@@ -0,0 +1,45 @@ +--- +description: 'System table containing a list of dictionary layouts supported by the
bad
review
ClickHouse/ClickHouse
c00a16a40690dcc4ac2f0115d37762520ed0a375
diff --git a/docs/en/operations/system-tables/dictionary_layouts.md b/docs/en/operations/system-tables/dictionary_layouts.md new file mode 100644 index 000000000000..fc1df6d066bd --- /dev/null +++ b/docs/en/operations/system-tables/dictionary_layouts.md @@ -0,0 +1,45 @@ +--- +description: 'System table containing a lis...
good
review_fixed
ClickHouse/ClickHouse
c00a16a40690dcc4ac2f0115d37762520ed0a375
@@ -175,6 +176,7 @@ void attachSystemTablesServer(ContextPtr context, IDatabase & system_database, b attach<StorageSystemTableFunctions>(context, system_database, "table_functions", "Contains a list of all available table functions with their descriptions."); attach<StorageSystemAggregateFunctionCombinators>(...
bad
review
cpp
ClickHouse/ClickHouse
c00a16a40690dcc4ac2f0115d37762520ed0a375
diff --git a/src/Storages/System/attachSystemTables.cpp b/src/Storages/System/attachSystemTables.cpp index 4c8a2b628178..df3a809d8e57 100644 --- a/src/Storages/System/attachSystemTables.cpp +++ b/src/Storages/System/attachSystemTables.cpp @@ -22,6 +22,7 @@ #include <Storages/System/StorageSystemDataSkippingIndices.h> ...
good
review_fixed
cpp
ClickHouse/ClickHouse
c00a16a40690dcc4ac2f0115d37762520ed0a375
@@ -178,6 +179,7 @@ void attachSystemTablesServer(ContextPtr context, IDatabase & system_database, b attach<StorageSystemTableFunctions>(context, system_database, "table_functions", "Contains a list of all available table functions with their descriptions."); attach<StorageSystemAggregateFunctionCombinators>(...
bad
review
cpp
ClickHouse/ClickHouse
c00a16a40690dcc4ac2f0115d37762520ed0a375
diff --git a/src/Storages/System/attachSystemTables.cpp b/src/Storages/System/attachSystemTables.cpp index 4c8a2b628178..df3a809d8e57 100644 --- a/src/Storages/System/attachSystemTables.cpp +++ b/src/Storages/System/attachSystemTables.cpp @@ -22,6 +22,7 @@ #include <Storages/System/StorageSystemDataSkippingIndices.h> ...
good
review_fixed
cpp
ClickHouse/ClickHouse
c00a16a40690dcc4ac2f0115d37762520ed0a375
@@ -200,12 +208,22 @@ class ThreadPoolImpl std::exception_ptr first_exception; std::stack<OnDestroyCallback> on_destroy_callbacks; + /// LIFO stack of idle threads for wake-up scheduling. + /// When a new job is scheduled, the most recently idle thread is woken first. + /// This concentrates work o...
bad
review
c
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/ThreadPool.h b/src/Common/ThreadPool.h index bb73c1a10041..1e82b48bdc61 100644 --- a/src/Common/ThreadPool.h +++ b/src/Common/ThreadPool.h @@ -64,6 +64,9 @@ class ThreadPoolImpl ~ThreadFromThreadPool(); private: + /// Allow enclosing ThreadPoolImpl to access per-thread idl...
good
review_fixed
c
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
@@ -200,12 +208,22 @@ class ThreadPoolImpl std::exception_ptr first_exception; std::stack<OnDestroyCallback> on_destroy_callbacks; + /// LIFO stack of idle threads for wake-up scheduling. + /// When a new job is scheduled, the most recently idle thread is woken first. + /// This concentrates work o...
bad
review
c
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/ThreadPool.h b/src/Common/ThreadPool.h index bb73c1a10041..1e82b48bdc61 100644 --- a/src/Common/ThreadPool.h +++ b/src/Common/ThreadPool.h @@ -64,6 +64,9 @@ class ThreadPoolImpl ~ThreadFromThreadPool(); private: + /// Allow enclosing ThreadPoolImpl to access per-thread idl...
good
review_fixed
c
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
@@ -730,15 +749,25 @@ void ThreadPoolImpl<Thread>::ThreadFromThreadPool::worker() parent_pool.job_finished.notify_all(); if (parent_pool.shutdown) - parent_pool.new_job_or_shutdown.notify_all(); /// `shutdown` was set, wake up other threads so they can finish thems...
bad
review
cpp
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/ThreadPool.cpp b/src/Common/ThreadPool.cpp index ca6fc24a9b54..cb5414214d45 100644 --- a/src/Common/ThreadPool.cpp +++ b/src/Common/ThreadPool.cpp @@ -12,6 +12,7 @@ #include <base/scope_guard.h> #include <type_traits> +#include <vector> #include <Poco/Util/Application.h> #include <Poco/U...
good
review_fixed
cpp
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
@@ -730,15 +749,37 @@ void ThreadPoolImpl<Thread>::ThreadFromThreadPool::worker() parent_pool.job_finished.notify_all(); if (parent_pool.shutdown) - parent_pool.new_job_or_shutdown.notify_all(); /// `shutdown` was set, wake up other threads so they can finish thems...
bad
review
cpp
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/ThreadPool.cpp b/src/Common/ThreadPool.cpp index ca6fc24a9b54..cb5414214d45 100644 --- a/src/Common/ThreadPool.cpp +++ b/src/Common/ThreadPool.cpp @@ -12,6 +12,7 @@ #include <base/scope_guard.h> #include <type_traits> +#include <vector> #include <Poco/Util/Application.h> #include <Poco/U...
good
review_fixed
cpp
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
@@ -730,15 +753,52 @@ void ThreadPoolImpl<Thread>::ThreadFromThreadPool::worker() parent_pool.job_finished.notify_all(); if (parent_pool.shutdown) - parent_pool.new_job_or_shutdown.notify_all(); /// `shutdown` was set, wake up other threads so they can finish thems...
bad
review
cpp
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/ThreadPool.cpp b/src/Common/ThreadPool.cpp index ca6fc24a9b54..cb5414214d45 100644 --- a/src/Common/ThreadPool.cpp +++ b/src/Common/ThreadPool.cpp @@ -12,6 +12,7 @@ #include <base/scope_guard.h> #include <type_traits> +#include <vector> #include <Poco/Util/Application.h> #include <Poco/U...
good
review_fixed
cpp
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
@@ -512,9 +523,9 @@ void ThreadPoolImpl<Thread>::wait() std::is_same_v<Thread, std::thread> ? ProfileEvents::GlobalThreadPoolLockWaitMicroseconds : ProfileEvents::LocalThreadPoolLockWaitMicroseconds,
bad
review
cpp
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/ThreadPool.cpp b/src/Common/ThreadPool.cpp index ca6fc24a9b54..cb5414214d45 100644 --- a/src/Common/ThreadPool.cpp +++ b/src/Common/ThreadPool.cpp @@ -12,6 +12,7 @@ #include <base/scope_guard.h> #include <type_traits> +#include <vector> #include <Poco/Util/Application.h> #include <Poco/U...
good
review_fixed
cpp
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
@@ -207,7 +207,7 @@ void ThreadPoolImpl<Thread>::setMaxThreads(size_t value) else if (need_finish_free_threads) { /// Wake up free threads so they can finish themselves. - new_job_or_shutdown.notify_all(); + wakeUpAllIdleThreadsNoLock();
bad
review
cpp
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/ThreadPool.cpp b/src/Common/ThreadPool.cpp index ca6fc24a9b54..cb5414214d45 100644 --- a/src/Common/ThreadPool.cpp +++ b/src/Common/ThreadPool.cpp @@ -12,6 +12,7 @@ #include <base/scope_guard.h> #include <type_traits> +#include <vector> #include <Poco/Util/Application.h> #include <Poco/U...
good
review_fixed
cpp
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
@@ -730,15 +769,52 @@ void ThreadPoolImpl<Thread>::ThreadFromThreadPool::worker() parent_pool.job_finished.notify_all(); if (parent_pool.shutdown) - parent_pool.new_job_or_shutdown.notify_all(); /// `shutdown` was set, wake up other threads so they can finish thems...
bad
review
cpp
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/ThreadPool.cpp b/src/Common/ThreadPool.cpp index ca6fc24a9b54..cb5414214d45 100644 --- a/src/Common/ThreadPool.cpp +++ b/src/Common/ThreadPool.cpp @@ -12,6 +12,7 @@ #include <base/scope_guard.h> #include <type_traits> +#include <vector> #include <Poco/Util/Application.h> #include <Poco/U...
good
review_fixed
cpp
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
@@ -81,6 +85,18 @@ class ThreadPoolImpl // Stores the position of the thread in the parent thread pool list typename std::list<std::unique_ptr<ThreadFromThreadPool>>::iterator thread_it; + /// LIFO idle thread scheduling flag. + /// When a new job is scheduled, the most recently idle t...
bad
review
c
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/ThreadPool.h b/src/Common/ThreadPool.h index bb73c1a10041..1e82b48bdc61 100644 --- a/src/Common/ThreadPool.h +++ b/src/Common/ThreadPool.h @@ -64,6 +64,9 @@ class ThreadPoolImpl ~ThreadFromThreadPool(); private: + /// Allow enclosing ThreadPoolImpl to access per-thread idl...
good
review_fixed
c
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
@@ -418,10 +422,27 @@ ReturnType ThreadPoolImpl<Thread>::scheduleImpl(Job job, Priority priority, std: return on_error("cannot start the job or thread"); } + + /// Select the most recently idle thread (LIFO order) for priority wake-up. + /// LIFO scheduling concentrates work on few...
bad
review
cpp
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/ThreadPool.cpp b/src/Common/ThreadPool.cpp index ca6fc24a9b54..cb5414214d45 100644 --- a/src/Common/ThreadPool.cpp +++ b/src/Common/ThreadPool.cpp @@ -12,6 +12,7 @@ #include <base/scope_guard.h> #include <type_traits> +#include <vector> #include <Poco/Util/Application.h> #include <Poco/U...
good
review_fixed
cpp
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
@@ -511,10 +531,10 @@ void ThreadPoolImpl<Thread>::wait() ProfileEvents::increment( std::is_same_v<Thread, std::thread> ? ProfileEvents::GlobalThreadPoolLockWaitMicroseconds : ProfileEvents::LocalThreadPoolLockWaitMicroseconds, watch.elapsedMicroseconds()); - /// Signal here just in case. - ...
bad
review
cpp
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/ThreadPool.cpp b/src/Common/ThreadPool.cpp index ca6fc24a9b54..cb5414214d45 100644 --- a/src/Common/ThreadPool.cpp +++ b/src/Common/ThreadPool.cpp @@ -12,6 +12,7 @@ #include <base/scope_guard.h> #include <type_traits> +#include <vector> #include <Poco/Util/Application.h> #include <Poco/U...
good
review_fixed
cpp
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
@@ -730,15 +762,62 @@ void ThreadPoolImpl<Thread>::ThreadFromThreadPool::worker() parent_pool.job_finished.notify_all(); if (parent_pool.shutdown) - parent_pool.new_job_or_shutdown.notify_all(); /// `shutdown` was set, wake up other threads so they can finish thems...
bad
review
cpp
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/ThreadPool.cpp b/src/Common/ThreadPool.cpp index ca6fc24a9b54..cb5414214d45 100644 --- a/src/Common/ThreadPool.cpp +++ b/src/Common/ThreadPool.cpp @@ -12,6 +12,7 @@ #include <base/scope_guard.h> #include <type_traits> +#include <vector> #include <Poco/Util/Application.h> #include <Poco/U...
good
review_fixed
cpp
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
@@ -81,6 +84,26 @@ class ThreadPoolImpl // Stores the position of the thread in the parent thread pool list typename std::list<std::unique_ptr<ThreadFromThreadPool>>::iterator thread_it; + /// Per-thread condition variable for LIFO idle scheduling. + /// Each idle thread waits on its o...
bad
review
c
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/ThreadPool.h b/src/Common/ThreadPool.h index bb73c1a10041..1e82b48bdc61 100644 --- a/src/Common/ThreadPool.h +++ b/src/Common/ThreadPool.h @@ -64,6 +64,9 @@ class ThreadPoolImpl ~ThreadFromThreadPool(); private: + /// Allow enclosing ThreadPoolImpl to access per-thread idl...
good
review_fixed
c
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
@@ -0,0 +1,78 @@ +#include <Common/CurrentMetrics.h> +#include <Common/ThreadPool.h> + +#include <atomic> +#include <chrono> +#include <condition_variable> +#include <mutex> + +#include <gtest/gtest.h> + +namespace CurrentMetrics +{ + extern const Metric LocalThread; + extern const Metric LocalThreadActive; + ...
bad
review
cpp
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/tests/gtest_thread_pool_lifo.cpp b/src/Common/tests/gtest_thread_pool_lifo.cpp new file mode 100644 index 000000000000..268ed6df1da2 --- /dev/null +++ b/src/Common/tests/gtest_thread_pool_lifo.cpp @@ -0,0 +1,299 @@ +#include <Common/CurrentMetrics.h> +#include <Common/ThreadPool.h> + +#include <...
good
review_fixed
cpp
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
@@ -0,0 +1,78 @@ +#include <Common/CurrentMetrics.h> +#include <Common/ThreadPool.h> + +#include <atomic> +#include <chrono> +#include <condition_variable> +#include <mutex> + +#include <gtest/gtest.h> + +namespace CurrentMetrics +{ + extern const Metric LocalThread; + extern const Metric LocalThreadActive; + ...
bad
review
cpp
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/tests/gtest_thread_pool_lifo.cpp b/src/Common/tests/gtest_thread_pool_lifo.cpp new file mode 100644 index 000000000000..268ed6df1da2 --- /dev/null +++ b/src/Common/tests/gtest_thread_pool_lifo.cpp @@ -0,0 +1,299 @@ +#include <Common/CurrentMetrics.h> +#include <Common/ThreadPool.h> + +#include <...
good
review_fixed
cpp
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
@@ -733,15 +848,47 @@ void ThreadPoolImpl<Thread>::ThreadFromThreadPool::worker() parent_pool.job_finished.notify_all(); if (parent_pool.shutdown) - parent_pool.new_job_or_shutdown.notify_all(); /// `shutdown` was set, wake up other threads so they can finish thems...
bad
review
cpp
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/ThreadPool.cpp b/src/Common/ThreadPool.cpp index ca6fc24a9b54..cb5414214d45 100644 --- a/src/Common/ThreadPool.cpp +++ b/src/Common/ThreadPool.cpp @@ -12,6 +12,7 @@ #include <base/scope_guard.h> #include <type_traits> +#include <vector> #include <Poco/Util/Application.h> #include <Poco/U...
good
review_fixed
cpp
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
@@ -0,0 +1,269 @@ +#include <Common/CurrentMetrics.h> +#include <Common/ThreadPool.h> + +#include <atomic> +#include <chrono> +#include <condition_variable> +#include <mutex> +#include <set> +#include <thread> +#include <vector> + +#include <gtest/gtest.h> + +namespace CurrentMetrics +{ + extern const Metric LocalTh...
bad
review
cpp
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/tests/gtest_thread_pool_lifo.cpp b/src/Common/tests/gtest_thread_pool_lifo.cpp new file mode 100644 index 000000000000..268ed6df1da2 --- /dev/null +++ b/src/Common/tests/gtest_thread_pool_lifo.cpp @@ -0,0 +1,299 @@ +#include <Common/CurrentMetrics.h> +#include <Common/ThreadPool.h> + +#include <...
good
review_fixed
cpp
ClickHouse/ClickHouse
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
@@ -59,6 +59,16 @@ static void removeLowCardinalityFromResult(DataTypePtr & result_type, ColumnPtr } } +/// Expand a function result back to pre-filter size. The nested function may return an input column +/// unchanged (e.g. concat of one String arg), so `column` can alias the input variant subcolumn; +/// mut...
bad
review
cpp
ClickHouse/ClickHouse
8e3b04f3ffa1ecc0b659147b61f8728198a669e2
diff --git a/src/Functions/FunctionVariantAdaptor.cpp b/src/Functions/FunctionVariantAdaptor.cpp index f5fd599ab77e..68bf356ccfcd 100644 --- a/src/Functions/FunctionVariantAdaptor.cpp +++ b/src/Functions/FunctionVariantAdaptor.cpp @@ -59,6 +59,16 @@ static void removeLowCardinalityFromResult(DataTypePtr & result_type, ...
good
review_fixed
cpp
ClickHouse/ClickHouse
8e3b04f3ffa1ecc0b659147b61f8728198a669e2
@@ -785,6 +785,13 @@ void executeQueryWithParallelReplicas( chassert(max_replicas_to_use <= connection_pools.size()); connection_pools.resize(max_replicas_to_use); + std::shared_ptr<const QueryPlan> remote_query_plan; + if (new_context->getSettingsRef()[Setting::serialize_query_plan]) ...
bad
review
cpp
ClickHouse/ClickHouse
517ea582d303548bad870f4bd0d0878d7d4463e4
diff --git a/src/Interpreters/ClusterProxy/executeQuery.cpp b/src/Interpreters/ClusterProxy/executeQuery.cpp index 2a7214cf865e..df5a73c56b4d 100644 --- a/src/Interpreters/ClusterProxy/executeQuery.cpp +++ b/src/Interpreters/ClusterProxy/executeQuery.cpp @@ -738,7 +738,7 @@ void executeQueryWithParallelReplicas( ...
good
review_fixed
cpp
ClickHouse/ClickHouse
517ea582d303548bad870f4bd0d0878d7d4463e4
@@ -0,0 +1,23 @@ +SET enable_analyzer = 1, enable_materialized_cte = 1; +SET serialize_query_plan = 1; +SET enable_parallel_replicas = 1, max_parallel_replicas = 3;
bad
review
ClickHouse/ClickHouse
517ea582d303548bad870f4bd0d0878d7d4463e4
diff --git a/tests/queries/0_stateless/04227_pr_materialized_cte_set_subquery.sql b/tests/queries/0_stateless/04227_pr_materialized_cte_set_subquery.sql new file mode 100644 index 000000000000..4ef6fb5ac96f --- /dev/null +++ b/tests/queries/0_stateless/04227_pr_materialized_cte_set_subquery.sql @@ -0,0 +1,23 @@ +SET en...
good
review_fixed
ClickHouse/ClickHouse
517ea582d303548bad870f4bd0d0878d7d4463e4
@@ -6,7 +6,10 @@ include(ExternalProject) set(USE_DELTA_KERNEL_RS ${ENABLE_LIBRARIES}) -# MSAN: Disabled because ring does not generate the appropriate symbols +# MSAN: Disabled because `ring` is still pulled in via `object_store`'s `cloud` feature +# (for HMAC), and its hand-written assembly does not generate t...
bad
review
ClickHouse/ClickHouse
aa76a0be3379849517188824c10f205b4d190703
diff --git a/contrib/delta-kernel-rs-cmake/CMakeLists.txt b/contrib/delta-kernel-rs-cmake/CMakeLists.txt index 7fc6082ee436..77498621515d 100644 --- a/contrib/delta-kernel-rs-cmake/CMakeLists.txt +++ b/contrib/delta-kernel-rs-cmake/CMakeLists.txt @@ -6,7 +6,14 @@ include(ExternalProject) set(USE_DELTA_KERNEL_RS ${EN...
good
review_fixed
ClickHouse/ClickHouse
aa76a0be3379849517188824c10f205b4d190703
@@ -6,7 +6,10 @@ include(ExternalProject) set(USE_DELTA_KERNEL_RS ${ENABLE_LIBRARIES}) -# MSAN: Disabled because ring does not generate the appropriate symbols +# MSAN: Disabled because `ring` is still pulled in via `object_store`'s `cloud` feature +# (for HMAC), and its hand-written assembly does not generate t...
bad
review
ClickHouse/ClickHouse
aa76a0be3379849517188824c10f205b4d190703
diff --git a/contrib/delta-kernel-rs-cmake/CMakeLists.txt b/contrib/delta-kernel-rs-cmake/CMakeLists.txt index 7fc6082ee436..77498621515d 100644 --- a/contrib/delta-kernel-rs-cmake/CMakeLists.txt +++ b/contrib/delta-kernel-rs-cmake/CMakeLists.txt @@ -6,7 +6,14 @@ include(ExternalProject) set(USE_DELTA_KERNEL_RS ${EN...
good
review_fixed
ClickHouse/ClickHouse
aa76a0be3379849517188824c10f205b4d190703
@@ -0,0 +1,99 @@ +-- Test that EXPLAIN SYNTAX formats all operators as functions +-- Related to issue #94603 +-- Tests should output function notation (e.g., plus(1, 2)) instead of operator notation (e.g., 1 + 2) + +-- Basic arithmetic operators +EXPLAIN SYNTAX SELECT 1 + 2; +EXPLAIN SYNTAX SELECT 5 - 3; +EXPLAIN SYNTA...
bad
review
ClickHouse/ClickHouse
5bd94445fa4cc7e4f4c6b218e8dc149fe47cf9af
diff --git a/tests/queries/0_stateless/03800_explain_syntax_operators_as_functions.sql b/tests/queries/0_stateless/03800_explain_syntax_operators_as_functions.sql new file mode 100644 index 000000000000..5995614cdf32 --- /dev/null +++ b/tests/queries/0_stateless/03800_explain_syntax_operators_as_functions.sql @@ -0,0 +...
good
review_fixed
ClickHouse/ClickHouse
5bd94445fa4cc7e4f4c6b218e8dc149fe47cf9af
@@ -468,7 +468,13 @@ bool explainQueryTree( IAST::FormatSettings format_settings(settings.ast_one_line); format_settings.show_secrets = query_context->getSettingsRef()[Setting::format_display_secrets_in_show_and_select]; - query_tree->toAST()->format(buf, format_settings); + ConvertToA...
bad
review
cpp
ClickHouse/ClickHouse
5bd94445fa4cc7e4f4c6b218e8dc149fe47cf9af
diff --git a/src/Interpreters/InterpreterExplainQuery.cpp b/src/Interpreters/InterpreterExplainQuery.cpp index be4b226744eb..ce939803ec76 100644 --- a/src/Interpreters/InterpreterExplainQuery.cpp +++ b/src/Interpreters/InterpreterExplainQuery.cpp @@ -555,7 +555,8 @@ bool explainQueryTree( ASTPtr explained_query, ...
good
review_fixed
cpp
ClickHouse/ClickHouse
5bd94445fa4cc7e4f4c6b218e8dc149fe47cf9af
@@ -49,148 +49,88 @@ 1 1 1 1 2 2 2 \N --- cross --- -SELECT - a, - b, - t2_00826.a, - t2_00826.b +SELECT * FROM t1_00826 -ALL INNER JOIN t2_00826 ON a = t2_00826.a -WHERE a = t2_00826.a
bad
review
ClickHouse/ClickHouse
5bd94445fa4cc7e4f4c6b218e8dc149fe47cf9af
diff --git a/tests/queries/0_stateless/00826_cross_to_inner_join.oldanalyzer.reference b/tests/queries/0_stateless/00826_cross_to_inner_join.oldanalyzer.reference index d7e55a8e210b..f4a260c38322 100644 --- a/tests/queries/0_stateless/00826_cross_to_inner_join.oldanalyzer.reference +++ b/tests/queries/0_stateless/00826...
good
review_fixed
ClickHouse/ClickHouse
5bd94445fa4cc7e4f4c6b218e8dc149fe47cf9af
@@ -1,39 +1,39 @@ -- { echo } -explain syntax select negate(1), negate(-1), - -1, -(-1), (-1) in (-1); +explain syntax select -1, -(-1), - -1, -(-1), (-1) in (-1);
bad
review
ClickHouse/ClickHouse
5bd94445fa4cc7e4f4c6b218e8dc149fe47cf9af
diff --git a/tests/queries/0_stateless/01566_negate_formatting.reference b/tests/queries/0_stateless/01566_negate_formatting.reference index 56d80dad4b2c..06a6e3851db8 100644 --- a/tests/queries/0_stateless/01566_negate_formatting.reference +++ b/tests/queries/0_stateless/01566_negate_formatting.reference @@ -3,37 +3,3...
good
review_fixed
ClickHouse/ClickHouse
5bd94445fa4cc7e4f4c6b218e8dc149fe47cf9af
@@ -116,17 +116,17 @@ SELECT x1 FROM test ORDER BY -2 ASC -explain syntax select x3, if(x3 > 10, x3, plus(x1, x2)), x1 + x2 from test order by 2; +explain syntax select x3, if(x3 > 10, x3, x1 + x2), x1 + x2 from test order by 2;
bad
review
ClickHouse/ClickHouse
5bd94445fa4cc7e4f4c6b218e8dc149fe47cf9af
diff --git a/tests/queries/0_stateless/02006_test_positional_arguments.reference b/tests/queries/0_stateless/02006_test_positional_arguments.reference index 2b8863624c61..8b15f17be11f 100644 --- a/tests/queries/0_stateless/02006_test_positional_arguments.reference +++ b/tests/queries/0_stateless/02006_test_positional_a...
good
review_fixed
ClickHouse/ClickHouse
5bd94445fa4cc7e4f4c6b218e8dc149fe47cf9af
@@ -5,14 +5,14 @@ FROM system.one explain syntax select null is not null; SELECT _CAST(NULL, \'Nullable(Nothing)\') IS NOT NULL FROM system.one -explain syntax select isNull(null); -SELECT isNull(_CAST(NULL, \'Nullable(Nothing)\')) +explain syntax select null IS NULL;
bad
review
ClickHouse/ClickHouse
5bd94445fa4cc7e4f4c6b218e8dc149fe47cf9af
diff --git a/tests/queries/0_stateless/02035_isNull_isNotNull_format.reference b/tests/queries/0_stateless/02035_isNull_isNotNull_format.reference index 942858105d03..28cb53238127 100644 --- a/tests/queries/0_stateless/02035_isNull_isNotNull_format.reference +++ b/tests/queries/0_stateless/02035_isNull_isNotNull_format...
good
review_fixed
ClickHouse/ClickHouse
5bd94445fa4cc7e4f4c6b218e8dc149fe47cf9af
@@ -468,7 +469,16 @@ bool explainQueryTree( IAST::FormatSettings format_settings(settings.ast_one_line); format_settings.show_secrets = query_context->getSettingsRef()[Setting::format_display_secrets_in_show_and_select]; - query_tree->toAST()->format(buf, format_settings); + ConvertToA...
bad
review
cpp
ClickHouse/ClickHouse
5bd94445fa4cc7e4f4c6b218e8dc149fe47cf9af
diff --git a/src/Interpreters/InterpreterExplainQuery.cpp b/src/Interpreters/InterpreterExplainQuery.cpp index be4b226744eb..ce939803ec76 100644 --- a/src/Interpreters/InterpreterExplainQuery.cpp +++ b/src/Interpreters/InterpreterExplainQuery.cpp @@ -555,7 +555,8 @@ bool explainQueryTree( ASTPtr explained_query, ...
good
review_fixed
cpp
ClickHouse/ClickHouse
5bd94445fa4cc7e4f4c6b218e8dc149fe47cf9af
@@ -602,7 +603,17 @@ bool explainQueryTree( IAST::FormatSettings format_settings(settings.ast_one_line); format_settings.show_secrets = query_context->getSettingsRef()[Setting::format_display_secrets_in_show_and_select]; - query_tree->toAST()->format(buf, format_settings); + ConvertToA...
bad
review
cpp
ClickHouse/ClickHouse
5bd94445fa4cc7e4f4c6b218e8dc149fe47cf9af
diff --git a/src/Interpreters/InterpreterExplainQuery.cpp b/src/Interpreters/InterpreterExplainQuery.cpp index be4b226744eb..ce939803ec76 100644 --- a/src/Interpreters/InterpreterExplainQuery.cpp +++ b/src/Interpreters/InterpreterExplainQuery.cpp @@ -555,7 +555,8 @@ bool explainQueryTree( ASTPtr explained_query, ...
good
review_fixed
cpp
ClickHouse/ClickHouse
5bd94445fa4cc7e4f4c6b218e8dc149fe47cf9af
@@ -338,9 +338,9 @@ Parses a Well-Known Text (WKT) representation of a MultiLineString geometry and }, { "MultiLineString example", - "SELECT toTypeName(readWKTLineString('MULTILINESTRING ((1 1, 2 2, 3 3, 1 1))'));", + "SELECT toTypeName(readWKTMultiLineString('MULTILINESTRING ((1 1, 2 ...
bad
review
cpp
ClickHouse/ClickHouse
8d617d769b286ed421c0f5cb29b803bbf8c0ef94
diff --git a/src/Functions/readWkt.cpp b/src/Functions/readWkt.cpp index fa625463a2d7..369b2d75bb5a 100644 --- a/src/Functions/readWkt.cpp +++ b/src/Functions/readWkt.cpp @@ -338,11 +338,11 @@ Parses a Well-Known Text (WKT) representation of a MultiLineString geometry and }, { "MultiLineString exampl...
good
review_fixed
cpp
ClickHouse/ClickHouse
8d617d769b286ed421c0f5cb29b803bbf8c0ef94