Skip to content

Analyzer: bad cast in QueryAnalyzer::resolveLambda #62374

Closed

Description

@rschu1ze

Query SELECT tuple(mapSort(k -> k, map('a', 4))), mapUpdate(map('k1', 1), map('k2', 11)) GROUP BY 1 WITH CUBE throws a LOGICAL_ERROR with analyzer but goes through w/o analyzer.

https://fiddle.clickhouse.com/785c4e4b-57bd-47be-a115-27be1e660e99

Could not find this issue already registered, so opening a bug.

(discovered here)

2024.04.07 10:06:37.895512 [ 1780146 ] {b6fa7978-3723-4331-812c-a0c7b6f23999} <Fatal> : Logical error: 'Bad cast from type DB::ColumnNode to DB::IdentifierNode'.
2024.04.07 10:06:37.896204 [ 1780145 ] {} <Trace> BaseDaemon: Received signal 6
2024.04.07 10:06:37.896903 [ 1780956 ] {} <Fatal> BaseDaemon: ########## Short fault info ############
2024.04.07 10:06:37.896977 [ 1780956 ] {} <Fatal> BaseDaemon: (version 24.4.1.1, build id: C2C02E126AE1441D60B83F08C072CF3C9E5445AE, git hash: 633aeaaa765ae5de46451659391d62b48ec3b1f3) (from thread 1780146) Received signal 6
2024.04.07 10:06:37.897027 [ 1780956 ] {} <Fatal> BaseDaemon: Signal description: Aborted
2024.04.07 10:06:37.897054 [ 1780956 ] {} <Fatal> BaseDaemon:
2024.04.07 10:06:37.897123 [ 1780956 ] {} <Fatal> BaseDaemon: Stack trace: 0x00007fa436e969fc 0x00007fa436e42476 0x00007fa436e287f3 0x0000000012d30ff4 0x0000000012d31175 0x0000000012d316b1 0x000000000a59100a 0x000000000a5938ac 0x0000000019e5245c 0x0000000019e52359 0x0000000019e51ed9 0x000000001aae8955 0x000000001aae595f 0x000000001aacccea 0x000000001aacb0c1 0x000000001aad5261 0x000000001aac78f9 0x000000001aac5934 0x000000001aac55f3 0x000000001aab6d66 0x000000001af3020c 0
x000000001af2f578 0x000000001af31ef8 0x000000001af3162c 0x000000001af315dd 0x000000001af3157d 0x000000001af3153d 0x000000001af31505 0x000000001ae4d57e 0x000000001ae48afd 0x000000001ae4818d 0x000000001b5c2110 0x000000001b5bcd8a 0x000000001ce54400 0x000000001ce6a625 0x000000002144e7f9 0x000000002144f048 0x0000000021625af4 0x000000002162289a 0x00000000216215de 0x00007fa436e94ac3
2024.04.07 10:06:37.897184 [ 1780956 ] {} <Fatal> BaseDaemon: ########################################
2024.04.07 10:06:37.897393 [ 1780956 ] {} <Fatal> BaseDaemon: (version 24.4.1.1, build id: C2C02E126AE1441D60B83F08C072CF3C9E5445AE, git hash: 633aeaaa765ae5de46451659391d62b48ec3b1f3) (from thread 1780146) (query_id: b6fa7978-3723-4331-812c-a0c7b6f23999) (query: SELECT tuple(mapSort(k -> k, map('a', 4))), mapUpdate(map('k1', 1), map('k2', 11)) GROUP BY 1 WITH CUBE;) Received signal Aborted (6)
2024.04.07 10:06:37.897503 [ 1780956 ] {} <Fatal> BaseDaemon:
2024.04.07 10:06:37.897598 [ 1780956 ] {} <Fatal> BaseDaemon: Stack trace: 0x00007fa436e969fc 0x00007fa436e42476 0x00007fa436e287f3 0x0000000012d30ff4 0x0000000012d31175 0x0000000012d316b1 0x000000000a59100a 0x000000000a5938ac 0x0000000019e5245c 0x0000000019e52359 0x0000000019e51ed9 0x000000001aae8955 0x000000001aae595f 0x000000001aacccea 0x000000001aacb0c1 0x000000001aad5261 0x000000001aac78f9 0x000000001aac5934 0x000000001aac55f3 0x000000001aab6d66 0x000000001af3020c 0
x000000001af2f578 0x000000001af31ef8 0x000000001af3162c 0x000000001af315dd 0x000000001af3157d 0x000000001af3153d 0x000000001af31505 0x000000001ae4d57e 0x000000001ae48afd 0x000000001ae4818d 0x000000001b5c2110 0x000000001b5bcd8a 0x000000001ce54400 0x000000001ce6a625 0x000000002144e7f9 0x000000002144f048 0x0000000021625af4 0x000000002162289a 0x00000000216215de 0x00007fa436e94ac3
2024.04.07 10:06:37.897724 [ 1780956 ] {} <Fatal> BaseDaemon: 4. ? @ 0x00007fa436e969fc
2024.04.07 10:06:37.897798 [ 1780956 ] {} <Fatal> BaseDaemon: 5. ? @ 0x00007fa436e42476
2024.04.07 10:06:37.897900 [ 1780956 ] {} <Fatal> BaseDaemon: 6. ? @ 0x00007fa436e287f3
2024.04.07 10:06:37.965157 [ 1780956 ] {} <Fatal> BaseDaemon: 7. /home/ubuntu/repo/ch5/src/Common/Exception.cpp:0: DB::abortOnFailedAssertion(String const&) @ 0x0000000012d30ff4
2024.04.07 10:06:38.030120 [ 1780956 ] {} <Fatal> BaseDaemon: 8. /home/ubuntu/repo/ch5/src/Common/Exception.cpp:64: DB::handle_error_code(String const&, int, bool, std::vector<void*, std::allocator<void*>> const&) @ 0x0000000012d31175
2024.04.07 10:06:38.082514 [ 1780956 ] {} <Fatal> BaseDaemon: 9. /home/ubuntu/repo/ch5/src/Common/Exception.cpp:101: DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x0000000012d316b1
2024.04.07 10:06:38.131029 [ 1780956 ] {} <Fatal> BaseDaemon: 10. /home/ubuntu/repo/ch5/src/Common/Exception.h:90: DB::Exception::Exception(String&&, int, bool) @ 0x000000000a59100a
2024.04.07 10:06:38.180442 [ 1780956 ] {} <Fatal> BaseDaemon: 11. /home/ubuntu/repo/ch5/src/Common/Exception.h:109: DB::Exception::Exception<String, String>(int, FormatStringHelperImpl<std::type_identity<String>::type, std::type_identity<String>::type>, String&&, String&&) @ 0x000000000a5938ac
2024.04.07 10:06:38.275737 [ 1780956 ] {} <Fatal> BaseDaemon: 12. /home/ubuntu/repo/ch5/src/Common/typeid_cast.h:33: DB::IdentifierNode& typeid_cast<DB::IdentifierNode&, DB::IQueryTreeNode>(DB::IQueryTreeNode&) @ 0x0000000019e5245c
2024.04.07 10:06:38.368799 [ 1780956 ] {} <Fatal> BaseDaemon: 13. /home/ubuntu/repo/ch5/src/Common/TypePromotion.h:26: DB::TypePromotion<DB::IQueryTreeNode>::CastHelper<DB::IdentifierNode&, false, true>::value(DB::IQueryTreeNode*) @ 0x0000000019e52359
2024.04.07 10:06:38.460184 [ 1780956 ] {} <Fatal> BaseDaemon: 14. /home/ubuntu/repo/ch5/src/Common/TypePromotion.h:52: std::invoke_result<decltype(&CastHelper<DB::IdentifierNode&, false>::value), DB::TypePromotion<DB::IQueryTreeNode>::CastHelper<DB::IdentifierNode&, false, std::is_reference_v<DB::IdentifierNode&>>, DB::IQueryTreeNode*>::type DB::TypePromotion<DB::IQueryTreeNode>::as<DB::IdentifierNode&>() @ 0x0000000019e51ed9
2024.04.07 10:06:38.848179 [ 1780956 ] {} <Fatal> BaseDaemon: 15. /home/ubuntu/repo/ch5/src/Analyzer/Passes/QueryAnalysisPass.cpp:5184: DB::(anonymous namespace)::QueryAnalyzer::resolveLambda(std::shared_ptr<DB::IQueryTreeNode> const&, std::shared_ptr<DB::IQueryTreeNode> const&, std::vector<std::shared_ptr<DB::IQueryTreeNode>, std::allocator<std::shared_ptr<DB::IQueryTreeNode>>> const&, DB::(anonymous namespace)::IdentifierResolveScope&) @ 0x000000001aae8955
2024.04.07 10:06:39.178283 [ 1780956 ] {} <Fatal> BaseDaemon: 16. /home/ubuntu/repo/ch5/src/Analyzer/Passes/QueryAnalysisPass.cpp:5931: DB::(anonymous namespace)::QueryAnalyzer::resolveFunction(std::shared_ptr<DB::IQueryTreeNode>&, DB::(anonymous namespace)::IdentifierResolveScope&) @ 0x000000001aae595f
2024.04.07 10:06:39.522764 [ 1780956 ] {} <Fatal> BaseDaemon: 17. /home/ubuntu/repo/ch5/src/Analyzer/Passes/QueryAnalysisPass.cpp:6373: DB::(anonymous namespace)::QueryAnalyzer::resolveExpressionNode(std::shared_ptr<DB::IQueryTreeNode>&, DB::(anonymous namespace)::IdentifierResolveScope&, bool, bool) @ 0x000000001aacccea
2024.04.07 10:06:39.872811 [ 1780956 ] {} <Fatal> BaseDaemon: 18. /home/ubuntu/repo/ch5/src/Analyzer/Passes/QueryAnalysisPass.cpp:6508: DB::(anonymous namespace)::QueryAnalyzer::resolveExpressionNodeList(std::shared_ptr<DB::IQueryTreeNode>&, DB::(anonymous namespace)::IdentifierResolveScope&, bool, bool) @ 0x000000001aacb0c1
2024.04.07 10:06:40.231043 [ 1780956 ] {} <Fatal> BaseDaemon: 19. /home/ubuntu/repo/ch5/src/Analyzer/Passes/QueryAnalysisPass.cpp:6719: DB::(anonymous namespace)::QueryAnalyzer::resolveGroupByNode(DB::QueryNode&, DB::(anonymous namespace)::IdentifierResolveScope&) @ 0x000000001aad5261
2024.04.07 10:06:40.581616 [ 1780956 ] {} <Fatal> BaseDaemon: 20. /home/ubuntu/repo/ch5/src/Analyzer/Passes/QueryAnalysisPass.cpp:8031: DB::(anonymous namespace)::QueryAnalyzer::resolveQuery(std::shared_ptr<DB::IQueryTreeNode> const&, DB::(anonymous namespace)::IdentifierResolveScope&) @ 0x000000001aac78f9
2024.04.07 10:06:40.928548 [ 1780956 ] {} <Fatal> BaseDaemon: 21. /home/ubuntu/repo/ch5/src/Analyzer/Passes/QueryAnalysisPass.cpp:1127: DB::(anonymous namespace)::QueryAnalyzer::resolve(std::shared_ptr<DB::IQueryTreeNode>&, std::shared_ptr<DB::IQueryTreeNode> const&, std::shared_ptr<DB::Context const>) @ 0x000000001aac5934
2024.04.07 10:06:41.274412 [ 1780956 ] {} <Fatal> BaseDaemon: 22. /home/ubuntu/repo/ch5/src/Analyzer/Passes/QueryAnalysisPass.cpp:8226: DB::QueryAnalysisPass::run(std::shared_ptr<DB::IQueryTreeNode>&, std::shared_ptr<DB::Context const>) @ 0x000000001aac55f3
2024.04.07 10:06:41.340876 [ 1780956 ] {} <Fatal> BaseDaemon: 23. /home/ubuntu/repo/ch5/src/Analyzer/QueryTreePassManager.cpp:186: DB::QueryTreePassManager::run(std::shared_ptr<DB::IQueryTreeNode>) @ 0x000000001aab6d66
2024.04.07 10:06:41.435686 [ 1780956 ] {} <Fatal> BaseDaemon: 24. /home/ubuntu/repo/ch5/src/Interpreters/InterpreterSelectQueryAnalyzer.cpp:115: DB::(anonymous namespace)::buildQueryTreeAndRunPasses(std::shared_ptr<DB::IAST> const&, DB::SelectQueryOptions const&, std::shared_ptr<DB::Context const> const&, std::shared_ptr<DB::IStorage> const&) @ 0x000000001af3020c
2024.04.07 10:06:41.514857 [ 1780956 ] {} <Fatal> BaseDaemon: 25. /home/ubuntu/repo/ch5/src/Interpreters/InterpreterSelectQueryAnalyzer.cpp:132: DB::InterpreterSelectQueryAnalyzer::InterpreterSelectQueryAnalyzer(std::shared_ptr<DB::IAST> const&, std::shared_ptr<DB::Context const> const&, DB::SelectQueryOptions const&) @ 0x000000001af2f578
2024.04.07 10:06:41.607953 [ 1780956 ] {} <Fatal> BaseDaemon: 26. /home/ubuntu/repo/ch5/contrib/llvm-project/libcxx/include/__memory/unique_ptr.h:714: std::__unique_if<DB::InterpreterSelectQueryAnalyzer>::__unique_single std::make_unique[abi:v15000]<DB::InterpreterSelectQueryAnalyzer, std::shared_ptr<DB::IAST>&, std::shared_ptr<DB::Context> const&, DB::SelectQueryOptions const&>(std::shared_ptr<DB::IAST>&, std::shared_ptr<DB::Context> const&, DB::SelectQueryOptions const
&) @ 0x000000001af31ef8
2024.04.07 10:06:41.697813 [ 1780956 ] {} <Fatal> BaseDaemon: 27. /home/ubuntu/repo/ch5/src/Interpreters/InterpreterSelectQueryAnalyzer.cpp:241: DB::registerInterpreterSelectQueryAnalyzer(DB::InterpreterFactory&)::$_0::operator()(DB::InterpreterFactory::Arguments const&) const @ 0x000000001af3162c
2024.04.07 10:06:41.790205 [ 1780956 ] {} <Fatal> BaseDaemon: 28. /home/ubuntu/repo/ch5/contrib/llvm-project/libcxx/include/__functional/invoke.h:394: ? @ 0x000000001af315dd
2024.04.07 10:06:41.879997 [ 1780956 ] {} <Fatal> BaseDaemon: 29. /home/ubuntu/repo/ch5/contrib/llvm-project/libcxx/include/__functional/invoke.h:470: ? @ 0x000000001af3157d
2024.04.07 10:06:41.969644 [ 1780956 ] {} <Fatal> BaseDaemon: 30. /home/ubuntu/repo/ch5/contrib/llvm-project/libcxx/include/__functional/function.h:235: ? @ 0x000000001af3153d
2024.04.07 10:06:42.059201 [ 1780956 ] {} <Fatal> BaseDaemon: 31. /home/ubuntu/repo/ch5/contrib/llvm-project/libcxx/include/__functional/function.h:716: ? @ 0x000000001af31505
2024.04.07 10:06:42.108832 [ 1780956 ] {} <Fatal> BaseDaemon: 32. /home/ubuntu/repo/ch5/contrib/llvm-project/libcxx/include/__functional/function.h:848: ? @ 0x000000001ae4d57e
2024.04.07 10:06:42.152194 [ 1780956 ] {} <Fatal> BaseDaemon: 33. /home/ubuntu/repo/ch5/contrib/llvm-project/libcxx/include/__functional/function.h:1187: ? @ 0x000000001ae48afd
2024.04.07 10:06:42.194331 [ 1780956 ] {} <Fatal> BaseDaemon: 34. /home/ubuntu/repo/ch5/src/Interpreters/InterpreterFactory.cpp:355: DB::InterpreterFactory::get(std::shared_ptr<DB::IAST>&, std::shared_ptr<DB::Context>, DB::SelectQueryOptions const&) @ 0x000000001ae4818d
2024.04.07 10:06:42.394188 [ 1780956 ] {} <Fatal> BaseDaemon: 35. /home/ubuntu/repo/ch5/src/Interpreters/executeQuery.cpp:1133: DB::executeQueryImpl(char const*, char const*, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum, DB::ReadBuffer*) @ 0x000000001b5c2110
2024.04.07 10:06:42.602458 [ 1780956 ] {} <Fatal> BaseDaemon: 36. /home/ubuntu/repo/ch5/src/Interpreters/executeQuery.cpp:1374: DB::executeQuery(String const&, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum) @ 0x000000001b5bcd8a

Activity

  1. added
    analyzer
    on Apr 7, 2024
  2. yakov-olkhovskiy commented on Apr 10, 2024

    @yakov-olkhovskiy
    Member

    fixed here:
    07893fa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

analyzer

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions