-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Logical error: 'Function dictGetUInt64(...) expects argument 1 to have LowCardinality(Nullable(UInt8)) type but receives Nullable(UInt8) after running InverseDictionaryLookupPass pass' #91489
Copy link
Copy link
Closed
Labels
bugConfirmed user-visible misbehaviour in official releaseConfirmed user-visible misbehaviour in official release
Description
SET allow_suspicious_low_cardinality_types=1;
CREATE TABLE ref_colors (`id` UInt64, `name` String, `n` UInt64) ENGINE = MergeTree ORDER BY id;
CREATE DICTIONARY colors (`id` UInt64, `name` String, `n` UInt64) PRIMARY KEY id SOURCE(CLICKHOUSE(TABLE 'ref_colors')) LIFETIME(MIN 0 MAX 0) LAYOUT(HASHED());
CREATE TABLE t__fuzz_1 (`color_id` LowCardinality(Nullable(UInt64)), `payload` LowCardinality(String)) ENGINE = MergeTree ORDER BY color_id SETTINGS allow_nullable_key=1;
EXPLAIN SELECT DISTINCT color_id, assumeNotNull(0) FROM t__fuzz_1 WHERE materialize(10) > dictGetUInt64(toFixedString(toFixedString('red', 3), toUInt128(3)) = dictGetString(toLowCardinality('colors'), toFixedString('name', 4), color_id), 'colors', 'n', color_id) ORDER BY ALL ASC NULLS LAST;2025.12.04 13:30:19.626913 [ 859332 ] {ffb179a8-a2df-4cb3-82dc-33963d6f733d} <Fatal> : Logical error: 'Function dictGetUInt64(__table1.color_id IN (SELECT __table1.id AS id FROM dictionary(_CAST('colors', 'LowCardinality(String)')) AS __table1 WHERE _CAST('red', 'FixedString(3)') = _CAST(__table1.name, 'LowCardinality(Nullable(String))')), 'colors', 'n', __table1.color_id) expects argument 1 to have LowCardinality(Nullable(UInt8)) type but receives Nullable(UInt8) after running InverseDictionaryLookupPass pass'.
2025.12.04 13:30:19.649620 [ 859332 ] {ffb179a8-a2df-4cb3-82dc-33963d6f733d} <Fatal> : Stack trace (when copying this message, always include the lines below):
0. /home/avogar/ClickHouse/contrib/llvm-project/libcxx/include/__exception/exception.h:113: Poco::Exception::Exception(String const&, int) @ 0x0000000022d561b2
1. /home/avogar/ClickHouse/src/Common/Exception.cpp:129: DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x0000000013831a9e
2. /home/avogar/ClickHouse/src/Common/Exception.h:123: DB::Exception::Exception(String&&, int, String, bool) @ 0x000000000b93db4e
3. /home/avogar/ClickHouse/src/Common/Exception.h:58: DB::Exception::Exception(PreformattedMessage&&, int) @ 0x000000000b93d685
4. /home/avogar/ClickHouse/src/Common/Exception.h:141: DB::Exception::Exception<String, unsigned long, String, String, String const&>(int, FormatStringHelperImpl<std::type_identity<String>::type, std::type_identity<unsigned long>::type, std::type_identity<String>::type, std::type_identity<String>::type, std::type_identity<String const&>::type>, String&&, unsigned long&&, String&&, String&&, String const&) @ 0x000000001898de39
5. /home/avogar/ClickHouse/src/Analyzer/QueryTreePassManager.cpp:158: DB::InDepthQueryTreeVisitor<DB::(anonymous namespace)::ValidationChecker, false>::visit(std::shared_ptr<DB::IQueryTreeNode>&) @ 0x000000001898bc8f
6. /home/avogar/ClickHouse/src/Analyzer/InDepthQueryTreeVisitor.h:90: DB::InDepthQueryTreeVisitor<DB::(anonymous namespace)::ValidationChecker, false>::visit(std::shared_ptr<DB::IQueryTreeNode>&) @ 0x000000001898b767
7. /home/avogar/ClickHouse/src/Analyzer/InDepthQueryTreeVisitor.h:90: DB::InDepthQueryTreeVisitor<DB::(anonymous namespace)::ValidationChecker, false>::visit(std::shared_ptr<DB::IQueryTreeNode>&) @ 0x000000001898b767
8. /home/avogar/ClickHouse/src/Analyzer/InDepthQueryTreeVisitor.h:90: DB::InDepthQueryTreeVisitor<DB::(anonymous namespace)::ValidationChecker, false>::visit(std::shared_ptr<DB::IQueryTreeNode>&) @ 0x000000001898b767
9. /home/avogar/ClickHouse/src/Analyzer/QueryTreePassManager.cpp:196: DB::QueryTreePassManager::run(std::shared_ptr<DB::IQueryTreeNode>&) @ 0x000000001898b4a4
10. /home/avogar/ClickHouse/src/Interpreters/InterpreterSelectQueryAnalyzer.cpp:165: DB::buildQueryTreeAndRunPasses(std::shared_ptr<DB::IAST> const&, DB::SelectQueryOptions const&, std::shared_ptr<DB::Context const> const&, std::shared_ptr<DB::IStorage> const&) @ 0x00000000194d0fbb
11. /home/avogar/ClickHouse/src/Interpreters/InterpreterSelectQueryAnalyzer.cpp:182: DB::InterpreterSelectQueryAnalyzer::InterpreterSelectQueryAnalyzer(std::shared_ptr<DB::IAST> const&, std::shared_ptr<DB::Context const> const&, DB::SelectQueryOptions const&, std::vector<String, std::allocator<String>> const&) @ 0x00000000194cf838
12. /home/avogar/ClickHouse/src/Interpreters/InterpreterExplainQuery.cpp:572: DB::InterpreterExplainQuery::executeImpl() @ 0x00000000194491f2
13. /home/avogar/ClickHouse/src/Interpreters/InterpreterExplainQuery.cpp:144: DB::InterpreterExplainQuery::execute() @ 0x0000000019448abf
14. /home/avogar/ClickHouse/src/Interpreters/executeQuery.cpp:1700: 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&) @ 0x000000001981422d
15. /home/avogar/ClickHouse/src/Interpreters/executeQuery.cpp:1921: DB::executeQuery(String const&, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum) @ 0x000000001980edc3
16. /home/avogar/ClickHouse/src/Client/LocalConnection.cpp:272: DB::LocalConnection::sendQuery(DB::ConnectionTimeouts const&, String const&, std::unordered_map<String, String, std::hash<String>, std::equal_to<String>, std::allocator<std::pair<String const, String>>> const&, String const&, unsigned long, DB::Settings const*, DB::ClientInfo const*, bool, std::vector<String, std::allocator<String>> const&, std::function<void (DB::Progress const&)>) @ 0x000000001cab3b4f
17. /home/avogar/ClickHouse/src/Client/ClientBase.cpp:1288: DB::ClientBase::processOrdinaryQuery(String, std::shared_ptr<DB::IAST>) @ 0x000000001ca3787b
18. /home/avogar/ClickHouse/src/Client/ClientBase.cpp:2338: DB::ClientBase::processParsedSingleQuery(std::basic_string_view<char, std::char_traits<char>>, std::shared_ptr<DB::IAST>, bool&, unsigned long) @ 0x000000001ca35c1d
19. /home/avogar/ClickHouse/src/Client/ClientBase.cpp:2715: DB::ClientBase::executeMultiQuery(String const&) @ 0x000000001ca41384
20. /home/avogar/ClickHouse/src/Client/ClientBase.cpp:2956: DB::ClientBase::processQueryText(String const&) @ 0x000000001ca424b0
21. /home/avogar/ClickHouse/src/Client/ClientBase.cpp:3666: DB::ClientBase::runInteractive() @ 0x000000001ca4ba1b
22. /home/avogar/ClickHouse/programs/local/LocalServer.cpp:0: DB::LocalServer::main(std::vector<String, std::allocator<String>> const&) @ 0x0000000013b28933
23. /home/avogar/ClickHouse/base/poco/Util/src/Application.cpp:315: Poco::Util::Application::run() @ 0x0000000022e303e6
24. /home/avogar/ClickHouse/programs/local/LocalServer.cpp:1242: mainEntryClickHouseLocal(int, char**) @ 0x0000000013b386e1
25. /home/avogar/ClickHouse/programs/main.cpp:380: main @ 0x000000000b930566
26. __pow_finite@GLIBC_2.15 @ 0x0000000000029d90
27. __libc_start_main_alias_1 @ 0x0000000000029e40
28. _start @ 0x000000000b92f5ae
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugConfirmed user-visible misbehaviour in official releaseConfirmed user-visible misbehaviour in official release