ClickHouse / ClickHouse/ClickHouse
Input initializer is not set. (LOGICAL_ERROR) Parallel replicas
- Dominant language
- C++
- Stars
- 49.9k
- Forks
- 9k
- Avg merge
- 21h 32m
- Merged PRs (30d)
- 515
Description
### Company or project name
_No response_
### Describe what's wrong
Logical error in test run when run test `00952_input_function.sh` with MergeTree instead of Memory engine (`clickhouse-test --replace-log-memory-with-mergetree`) and enabled parallel replicas.
[Report](https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=80103&sha=d0a11c8d9c4302af458b87ff45c844919002b04e&name_0=PR&name_1=Stateless%20tests%20%28release%2C%20ParallelReplicas%2C%20s3%20storage%29)
Error:
```
2025.05.18 19:56:22.481929 [ 219362 ] {467d1e16-aa43-4d4d-9c28-9c2b3d39761c} executeQuery: Code: 49. DB::Exception: Input initializer is not set. (LOGICAL_ERROR) (version 25.6.1.246 (official build)) (from [::1]:42372) (comment: 00952_input_function.sh) (query 1, line 1) (in query: INSERT INTO input_function_table_3 (a, b, c) SELECT * FROM (SELECT s, b, c*c FROM input('s String, b Int32, c Int32') js1 JOIN input_function_table_1 ON s=input_function_table_1.a) FORMAT CSV), Stack trace (when copying this message, always include the lines below):
0. ./ci/tmp/build/./src/Common/Exception.cpp:110: DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x000000000fceabdb
1. DB::Exception::Exception(PreformattedMessage&&, int) @ 0x0000000009f181cc
2. DB::Exception::Exception<>(int, FormatStringHelperImpl<>) @ 0x0000000009f24a0b
3. ./ci/tmp/build/./src/Interpreters/Context.cpp:5629: DB::Context::initializeInput(std::shared_ptr const&) @ 0x0000000013acc187
4. ./ci/tmp/build/./src/Storages/StorageInput.cpp:97: DB::StorageInput::read(DB::QueryPlan&, std::vector> const&, std::shared_ptr const&, DB::SelectQueryInfo&, std::shared_ptr, DB::QueryProcessingStage::Enum, unsigned long, unsigned long) @ 0x000000001470ce0e
5. ./ci/tmp/build/./src/Planner/PlannerJoinTree.cpp:1006: DB::(anonymous namespace)::buildQueryPlanForTableExpression(std::shared_ptr, std::shared_ptr const&, DB::SelectQueryInfo const&, DB::SelectQueryOptions const&, std::shared_ptr&, bool, bool) @ 0x0000000013626eea
6. ./ci/tmp/build/./src/Planner/PlannerJoinTree.cpp:2351: DB::buildJoinTreeQueryPlan(std::shared_ptr const&, DB::SelectQueryInfo const&, DB::SelectQueryOptions&, std::unordered_set, std::equal_to, std::allocator> const&, std::shared_ptr&) @ 0x000000001361c6ca
7. ./ci/tmp/build/./src/Planner/Planner.cpp:1596: DB::Planner::buildPlanForQueryNode() @ 0x0000000013364a6f
8. ./ci/tmp/build/./src/Planner/Planner.cpp:1369: DB::Planner::buildQueryPlanIfNeeded() @ 0x00000000133607be
9. ./src/Interpreters/InterpreterSelectQueryAnalyzer.cpp:275: DB::createLocalPlanForParallelReplicas(std::shared_ptr const&, DB::Block const&, std::shared_ptr, DB::QueryProcessingStage::Enum, std::shared_ptr, std::unique_ptr>, unsigned long) @ 0x00000000159a7a29
10. ./ci/tmp/build/./src/Interpreters/ClusterProxy/executeQuery.cpp:664: DB::ClusterProxy::executeQueryWithParallelReplicas(DB::QueryPlan&, DB::StorageID const&, DB::Block const&, DB::QueryProcessingStage::Enum, std::shared_ptr const&, std::shared_ptr, std::shared_ptr> const>, std::unique_ptr>) @ 0x00000000142db9d7
11. ./ci/tmp/build/./src/Interpreters/ClusterProxy/executeQuery.cpp:758: DB::ClusterProxy::executeQueryWithParallelReplicas(DB::QueryPlan&, DB::StorageID const&, DB::QueryProcessingStage::Enum, std::shared_ptr const&, std::shared_ptr const&, std::shared_ptr, std::shared_ptr> const>, std::unique_ptr>) @ 0x00000000142e0f8c
12. ./ci/tmp/build/./src/Planner/PlannerJoinTree.cpp:1144: DB::(anonymous namespace)::buildQueryPlanForTableExpression(std::shared_ptr, std::shared_ptr const&, DB::SelectQueryInfo const&, DB::SelectQueryOptions const&, std::shared_ptr&, bool, bool) @ 0x0000000013628e48
13. ./ci/tmp/build/./src/Planner/PlannerJoinTree.cpp:2465: DB::buildJoinTreeQueryPlan(std::shared_ptr const&, DB::SelectQueryInfo const&, DB::SelectQueryOptions&, std::unordered_set, std::equal_to, std::allocator> const&, std::shared_ptr&) @ 0x000000001361ddc6
14. ./ci/tmp/build/./src/Planner/Planner.cpp:1596: DB::Planner::buildPlanForQueryNode() @ 0x0000000013364a6f
15. ./ci/tmp/build/./src/Planner/Planner.cpp:1369: DB::Planner::buildQueryPlanIfNeeded() @ 0x00000000133607be
16. ./ci/tmp/build/./src/Planner/PlannerJoinTree.cpp:1262: DB::(anonymous namespace)::buildQueryPlanForTableExpression(std::shared_ptr, std::shared_ptr const&, DB::SelectQueryInfo const&, DB::SelectQueryOptions const&, std::shared_ptr&, bool, bool) @ 0x0000000013622b2a
17. ./ci/tmp/build/./src/Planner/PlannerJoinTree.cpp:2351: DB::buildJoinTreeQueryPlan(std::shared_ptr const&, DB::SelectQueryInfo const&, DB::SelectQueryOptions&, std::unordered_set, std::equal_to, std::allocator> const&, std::shared_ptr&) @ 0x000000001361c6ca
18. ./ci/tmp/build/./src/Planner/Planner.cpp:1596: DB::Planner::buildPlanForQueryNode() @ 0x0000000013364a6f
19. ./ci/tmp/build/./src/Planner/Planner.cpp:1369: DB::Planner::buildQueryPlanIfNeeded() @ 0x00000000133607be
20. ./ci/tmp/build/./src/Interpreters/InterpreterSelectQueryAnalyzer.cpp:281: DB::InterpreterSelectQueryAnalyzer::buildQueryPipeline() @ 0x0000000013d3b99d
21. ./ci/tmp/build/./src/Interpreters/InterpreterInsertQuery.cpp:559: DB::InterpreterInsertQuery::execute() @ 0x0000000013cc6f19
22. ./ci/tmp/build/./src/Interpreters/executeQuery.cpp:1522: DB::executeQueryImpl(char const*, char const*, std::shared_ptr, DB::QueryFlags, DB::QueryProcessingStage::Enum, DB::ReadBuffer*, std::shared_ptr&) @ 0x0000000014091d08
23. ./ci/tmp/build/./src/Interpreters/executeQuery.cpp:1714: DB::executeQuery(String const&, std::shared_ptr, DB::QueryFlags, DB::QueryProcessingStage::Enum) @ 0x000000001408b3ba
24. ./ci/tmp/build/./src/Server/TCPHandler.cpp:685: DB::TCPHandler::runImpl() @ 0x0000000015427cbe
25. ./ci/tmp/build/./src/Server/TCPHandler.cpp:2673: DB::TCPHandler::run() @ 0x0000000015446dd9
26. ./ci/tmp/build/./base/poco/Net/src/TCPServerConnection.cpp:40: Poco::Net::TCPServerConnection::start() @ 0x0000000018b59767
27. ./ci/tmp/build/./base/poco/Net/src/TCPServerDispatcher.cpp:115: Poco::Net::TCPServerDispatcher::run() @ 0x0000000018b59bb9
28. ./ci/tmp/build/./base/poco/Foundation/src/ThreadPool.cpp:205: Poco::PooledThread::run() @ 0x0000000018b24e9b
29. ./base/poco/Foundation/src/Thread_POSIX.cpp:335: Poco::ThreadImpl::runnableEntry(void*) @ 0x0000000018b2337d
30. ? @ 0x00007fc8aab5dac3
31. ? @ 0x00007fc8aabef850
```
### Does it reproduce on the most recent release?
Yes
### How to reproduce
Part of test which causes error:
```
${CLICKHOUSE_CLIENT} --query="DROP TABLE IF EXISTS input_function_table_3"
${CLICKHOUSE_CLIENT} --query="CREATE TABLE input_function_table_3 (a String, b Date, c Int32, d Int16) ENGINE=MergeTree() ORDER BY tuple()"
cat "${CLICKHOUSE_TMP}"/data_for_input_function.csv | ${CLICKHOUSE_CLIENT} --query="INSERT INTO input_function_table_3 (a, b, c) SELECT * FROM (SELECT s, b, c*c FROM input('s String, b Int32, c Int32') js1 JOIN input_function_table_1 ON s=input_function_table_1.a) FORMAT CSV"
```
Contributor guide
Assessment
This issue has not been assessed yet.