Error:
Logical error: 'Bad cast from type DB::FunctionNode to DB::ConstantNode'.
---
Stack trace:
__GI___pthread_kill @ 0x00000000000969fd
raise @ 0x0000000000042476
__lgamma_r_finite @ 0x00000000000287f3
src/Common/Exception.cpp:57: DB::abortOnFailedAssertion(String const&, std::basic_string_view<char, std::char_traits<char>>, void* const*, unsigned long, unsigned long) @ 0x000000002030615d
src/Common/Exception.cpp:90: DB::handle_error_code(String const&, std::basic_string_view<char, std::char_traits<char>>, int, bool, std::vector<void*, std::allocator<void*>> const&) @ 0x0000000020306f7f
src/Common/Exception.cpp:143: DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x00000000203072f2
./src/Common/Exception.h:172: DB::Exception::Exception(String&&, int, String, bool) @ 0x0000000013e8fd63
./src/Common/Exception.h:58: DB::Exception::Exception(PreformattedMessage&&, int) @ 0x0000000013e8f301
./src/Common/Exception.h:190: DB::Exception::Exception<String, String>(int, FormatStringHelperImpl<std::type_identity<String>::type, std::type_identity<String>::type>, String&&, String&&) @ 0x0000000013e8e66f
./src/Common/typeid_cast.h:31: T typeid_cast<DB::ConstantNode&, DB::IQueryTreeNode>(DB::IQueryTreeNode&) @ 0x000000002828ee9e
inlined from ./src/Common/TypePromotion.h:31: DB::TypePromotion<DB::IQueryTreeNode>::CastHelper<DB::ConstantNode&, false, true>::value(DB::IQueryTreeNode*)
inlined from ./src/Common/TypePromotion.h:57: std::__invoke_result_impl<void, decltype(&CastHelper<DB::ConstantNode&, false>::value), DB::TypePromotion<DB::IQueryTreeNode>::CastHelper<DB::ConstantNode&, false, std::is_reference_v<DB::ConstantNode&>>, DB::IQueryTreeNode*>::type DB::TypePromotion<DB::IQueryTreeNode>::as<DB::ConstantNode&>()
src/Planner/Planner.cpp:463: QueryAnalysisResult
src/Planner/Planner.cpp:1917: DB::Planner::buildPlanForQueryNode() @ 0x00000000286b9ef1
src/Planner/Planner.cpp:1664: DB::Planner::buildQueryPlanIfNeeded() @ 0x00000000286b5667
src/Interpreters/InterpreterSelectQueryAnalyzer.cpp:334: DB::InterpreterSelectQueryAnalyzer::getSampleBlockAndPlannerContext() @ 0x000000002944f766
src/Interpreters/InterpreterSelectQueryAnalyzer.cpp:316: DB::InterpreterSelectQueryAnalyzer::getSampleBlockAndPlannerContext(std::shared_ptr<DB::IQueryTreeNode> const&, std::shared_ptr<DB::Context const> const&, DB::SelectQueryOptions const&)
src/Interpreters/InterpreterSelectQueryAnalyzer.cpp:323: DB::InterpreterSelectQueryAnalyzer::getSampleBlock(std::shared_ptr<DB::IQueryTreeNode> const&, std::shared_ptr<DB::Context const> const&, DB::SelectQueryOptions const&) @ 0x000000002944f8a9
src/Storages/StorageDistributed.cpp:978: DB::StorageDistributed::read(DB::QueryPlan&, std::vector<String, std::allocator<String>> const&, std::shared_ptr<DB::StorageSnapshot> const&, DB::SelectQueryInfo&, std::shared_ptr<DB::Context const>, DB::QueryProcessingStage::Enum, unsigned long, unsigned long) @ 0x000000002defdef8
src/Planner/PlannerJoinTree.cpp:1054: DB::(anonymous namespace)::buildQueryPlanForTableExpression(std::shared_ptr<DB::IQueryTreeNode>, std::shared_ptr<DB::IQueryTreeNode> const&, DB::SelectQueryInfo const&, DB::SelectQueryOptions const&, std::shared_ptr<DB::PlannerContext>&, bool, bool) @ 0x00000000286f4346
src/Planner/PlannerJoinTree.cpp:2638: DB::buildJoinTreeQueryPlan(std::shared_ptr<DB::IQueryTreeNode> const&, DB::SelectQueryInfo const&, DB::SelectQueryOptions&, std::unordered_set<String, std::hash<String>, std::equal_to<String>, std::allocator<String>> const&, std::shared_ptr<DB::PlannerContext>&) @ 0x00000000286e5f31
src/Planner/Planner.cpp:1893: DB::Planner::buildPlanForQueryNode() @ 0x00000000286b8fcb
src/Planner/Planner.cpp:1664: DB::Planner::buildQueryPlanIfNeeded() @ 0x00000000286b5667
src/Interpreters/InterpreterSelectQueryAnalyzer.cpp:353: DB::InterpreterSelectQueryAnalyzer::getQueryPlan() @ 0x000000002944ffde
src/Interpreters/executeQuery.cpp:1685: DB::executeQueryImpl(char const*, char const*, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum, std::unique_ptr<DB::ReadBuffer, std::default_delete<DB::ReadBuffer>>&, std::shared_ptr<DB::IAST>&, std::shared_ptr<DB::ImplicitTransactionControlExecutor>, std::function<void ()>, DB::QueryResultDetails&) @ 0x0000000029870b9b
src/Interpreters/executeQuery.cpp:1955: DB::executeQuery(String const&, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum) @ 0x000000002986bdc7
src/Server/TCPHandler.cpp:774: DB::TCPHandler::runImpl() @ 0x000000002f1dff42
src/Server/TCPHandler.cpp:2867: DB::TCPHandler::run() @ 0x000000002f20319c
base/poco/Net/src/TCPServerConnection.cpp:40: Poco::Net::TCPServerConnection::start() @ 0x0000000034e5644c
base/poco/Net/src/TCPServerDispatcher.cpp:115: Poco::Net::TCPServerDispatcher::run() @ 0x0000000034e56d5c
base/poco/Foundation/src/ThreadPool.cpp:205: Poco::PooledThread::run() @ 0x0000000034ddfb74
./base/poco/Foundation/src/Thread_POSIX.cpp:341: Poco::ThreadImpl::runnableEntry(void*) @ 0x0000000034ddc253
start_thread @ 0x0000000000094ac3
clone3 @ 0x00000000001268c0
Important: This issue was automatically generated and is used by CI for matching failures. DO NOT modify the body content. DO NOT remove labels.
Test name: Logical error: Bad cast from type A to B (STID: 1635-4058)
CI report: BuzzHouse (amd_ubsan)
CIDB statistics: cidb
Test output: