Skip to content

Allow arbitrary non-nullable types as key for maps - #59318

Merged
rschu1ze merged 14 commits into
ClickHouse:masterfrom
bigo-sg:complex_map_key
May 6, 2024
Merged

rschu1ze merged 14 commits into
ClickHouse:masterfrom
bigo-sg:complex_map_key

Conversation

@taiyang-li

@taiyang-li taiyang-li commented Jan 29, 2024 •

Copy link
Copy Markdown
Contributor

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Maps can now have Float32, Float64, Array(T), Map(K,V) and Tuple(T1, T2, ...) as keys. Closes #54537.

@taiyang-li
taiyang-li marked this pull request as draft January 29, 2024 03:28
@taiyang-li

This comment was marked as outdated.

@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-improvement Pull request with some product improvements label Jan 29, 2024
@robot-ch-test-poll4

robot-ch-test-poll4 commented Jan 29, 2024 •

Copy link
Copy Markdown
Contributor

This is an automated comment for commit c0ddd3d with description of existing statuses. It's updated for the latest CI running

❌ Click here to open a full report in a separate page

Check nameDescriptionStatus
AST fuzzerRuns randomly generated queries to catch program errors. The build type is optionally given in parenthesis. If it fails, ask a maintainer for help❌ failure
CI runningA meta-check that indicates the running CI. Normally, it's in success or pending state. The failed status indicates some problems with the PR⏳ pending
Stress testRuns stateless functional tests concurrently from several clients to detect concurrency-related errors❌ failure
Successful checks
Check nameDescriptionStatus
A SyncThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
ClickBenchRuns [ClickBench](https://github.com/ClickHouse/ClickBench/) with instant-attach table✅ success
ClickHouse build checkBuilds ClickHouse in various configurations for use in further steps. You have to fix the builds that fail. Build logs often has enough information to fix the error, but you might have to reproduce the failure locally. The cmake options can be found in the build log, grepping for cmake. Use these options and follow the general build process✅ success
Compatibility checkChecks that clickhouse binary runs on distributions with old libc versions. If it fails, ask a maintainer for help✅ success
Docker keeper imageThe check to build and optionally push the mentioned image to docker hub✅ success
Docker server imageThe check to build and optionally push the mentioned image to docker hub✅ success
Docs checkBuilds and tests the documentation✅ success
Fast testNormally this is the first check that is ran for a PR. It builds ClickHouse and runs most of stateless functional tests, omitting some. If it fails, further checks are not started until it is fixed. Look at the report to see which tests fail, then reproduce the failure locally as described here✅ success
Flaky testsChecks if new added or modified tests are flaky by running them repeatedly, in parallel, with more randomization. Functional tests are run 100 times with address sanitizer, and additional randomization of thread scheduling. Integrational tests are run up to 10 times. If at least once a new test has failed, or was too long, this check will be red. We don't allow flaky tests, read the doc✅ success
Install packagesChecks that the built packages are installable in a clear environment✅ success
Integration testsThe integration tests report. In parenthesis the package type is given, and in square brackets are the optional part/total tests✅ success
Mergeable CheckChecks if all other necessary checks are successful✅ success
PR CheckThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Performance ComparisonMeasure changes in query performance. The performance test report is described in detail here. In square brackets are the optional part/total tests✅ success
Stateful testsRuns stateful functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Stateless testsRuns stateless functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Style checkRuns a set of checks to keep the code style clean. If some of tests failed, see the related log from the report✅ success
Unit testsRuns the unit tests for different release types✅ success
Upgrade checkRuns stress tests on server version from last release and then tries to upgrade it to the version from the PR. It checks if the new server can successfully startup without any errors, crashes or sanitizer asserts✅ success

@taiyang-li
taiyang-li marked this pull request as ready for review January 31, 2024 02:29
@taiyang-li taiyang-li changed the title [WIP] Allow float32/float64/array/map/tuple as map key Allow float32/float64/array/map/tuple as map key Jan 31, 2024
@vdimir
vdimir marked this pull request as draft February 2, 2024 15:55
@taiyang-li
taiyang-li marked this pull request as ready for review February 5, 2024 04:20
@taiyang-li

This comment was marked as outdated.

@taiyang-li

This comment was marked as outdated.

@alexey-milovidov

This comment was marked as outdated.

Comment thread src/DataTypes/DataTypeMap.cpp Resolved
@rschu1ze

This comment was marked as outdated.

@taiyang-li taiyang-li changed the title Allow float32/float64/array/map/tuple as map key Allow arbitrary non-nullable type as map key, allow arbitrary type as map value Feb 27, 2024
@taiyang-li

This comment was marked as outdated.

@taiyang-li

This comment was marked as outdated.

@taiyang-li

This comment was marked as outdated.

@rschu1ze rschu1ze changed the title Allow arbitrary non-nullable type as map key, allow arbitrary type as map value Allow arbitrary non-nullable types as map key and value Mar 15, 2024

@rschu1ze rschu1ze left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks generally good to me.

I made a few fix-ups locally (docs, exception message text, etc) but I don't have permission to push to your repo:

~/repo/ch (complex_map_key %>) $ git push bigo-sg complex_map_key
remote: Permission to bigo-sg/ClickHouse.git denied to rschu1ze.
fatal: unable to access 'https://github.com/bigo-sg/ClickHouse.git/': The requested URL returned error: 403

Anyways, I can push them in a separate PR once this is merged.

The msan error looks related, it is triggered by 02169_map_functions.sql, kindly check it.

@taiyang-li

Copy link
Copy Markdown
Contributor Author

Looks generally good to me.

I made a few fix-ups locally (docs, exception message text, etc) but I don't have permission to push to your repo:

~/repo/ch (complex_map_key %>) $ git push bigo-sg complex_map_key
remote: Permission to bigo-sg/ClickHouse.git denied to rschu1ze.
fatal: unable to access 'https://github.com/bigo-sg/ClickHouse.git/': The requested URL returned error: 403

Anyways, I can push them in a separate PR once this is merged.

The msan error looks related, it is triggered by 02169_map_functions.sql, kindly check it.

Sorry to reply late. I rebuilt clickhouse with memory sanitizer locally, but it can't be reproduced.

@taiyang-li

taiyang-li commented Apr 2, 2024 •

Copy link
Copy Markdown
Contributor Author

image

Can't be reproduced in my local environment, are they noise or I'm wrong ? @rschu1ze

@rschu1ze rschu1ze changed the title Allow arbitrary non-nullable types as map key and value Map can now have arbitrary non-nullable types as key Apr 2, 2024
@rschu1ze rschu1ze changed the title Map can now have arbitrary non-nullable types as key Allow arbitrary non-nullable types as key for maps Apr 2, 2024
@rschu1ze

rschu1ze commented Apr 2, 2024 •

Copy link
Copy Markdown
Member

Sorry for the delay, just came back from vacation.

This query crashes with this PR (can be locally using a debug build):

SELECT tuple(mapSort(k -> k, map([toUInt128(4), 3, 1], materialize(toNullable(4)), [4], 5))), mapUpdate(map('k1', 1, toFixedString('k2', 2), 2), map(toFixedString('k1', 2), materialize(toLowCardinality(11)), 'k2', 22)) GROUP BY toUInt256(3), tuple(toNullable(1)), 1 WITH CUBE;

The same failure appears here.)

-->

2024.04.02 13:05:55.889308 [ 327659 ] {d12508c5-c6c2-41d3-be3f-82f742a88f15} <Fatal> : Logical error: 'Bad cast from type DB::ColumnNode to DB::IdentifierNode'.
2024.04.02 13:05:55.890245 [ 327528 ] {} <Trace> BaseDaemon: Received signal 6
2024.04.02 13:05:55.890926 [ 329632 ] {} <Fatal> BaseDaemon: ########## Short fault info ############
2024.04.02 13:05:55.891048 [ 329632 ] {} <Fatal> BaseDaemon: (version 24.4.1.1, build id: F057518A4FE64982A1867F03A09D33B6FD800F28, git hash: 5f786647fbc2c54dab9cd9885dffd4bfa4eec83a) (from thread 327659) Received signal 6
2024.04.02 13:05:55.891106 [ 329632 ] {} <Fatal> BaseDaemon: Signal description: Aborted
2024.04.02 13:05:55.891138 [ 329632 ] {} <Fatal> BaseDaemon:
2024.04.02 13:05:55.891212 [ 329632 ] {} <Fatal> BaseDaemon: Stack trace: 0x00007fc2a14969fc 0x00007fc2a1442476 0x00007fc2a14287f3 0x0000000012f8c703 0x0000000012f8c875 0x0000000012f8cdb1 0x000000000a5c560a 0x000000000a5c7eac 0x000000001a0d963c 0x000000001a0d9539 0x000000001a0d90b9 0x000000001ad75935 0x000000001ad7293f 0x000000001ad59cca 0x000000001ad580a1 0x000000001ad62241 0x000000001ad548d9 0x000000001ad52914 0x000000001ad525d3 0x000000001ad43d46 0x000000001b1bdb2c 0x0
00000001b1bce98 0x000000001b1bf818 0x000000001b1bef4c 0x000000001b1beefd 0x000000001b1bee9d 0x000000001b1bee5d 0x000000001b1bee25 0x000000001b0daa7e 0x000000001b0d5ffd 0x000000001b0d568d 0x000000001b85d250 0x000000001b857d4a 0x000000001d11b7c0 0x000000001d1327e5 0x000000002172cd99 0x000000002172d5e8 0x0000000021904094 0x0000000021900e3a 0x00000000218ffb7e 0x00007fc2a1494ac3
2024.04.02 13:05:55.891265 [ 329632 ] {} <Fatal> BaseDaemon: ########################################
2024.04.02 13:05:55.891436 [ 329632 ] {} <Fatal> BaseDaemon: (version 24.4.1.1, build id: F057518A4FE64982A1867F03A09D33B6FD800F28, git hash: 5f786647fbc2c54dab9cd9885dffd4bfa4eec83a) (from thread 327659) (query_id: d12508c5-c6c2-41d3-be3f-82f742a88f15) (query: SELECT tuple(mapSort(k -> k, map([toUInt128(4), 3, 1], materialize(toNullable(4)), [4], 5))), mapUpdate(map('k1', 1, toFixedString('k2', 2), 2), map(toFixedString('k1', 2), materialize(toLowCardinality(11)), 'k2',
22)) GROUP BY toUInt256(3), tuple(toNullable(1)), 1 WITH CUBE) Received signal Aborted (6)
2024.04.02 13:05:55.891549 [ 329632 ] {} <Fatal> BaseDaemon:
2024.04.02 13:05:55.891652 [ 329632 ] {} <Fatal> BaseDaemon: Stack trace: 0x00007fc2a14969fc 0x00007fc2a1442476 0x00007fc2a14287f3 0x0000000012f8c703 0x0000000012f8c875 0x0000000012f8cdb1 0x000000000a5c560a 0x000000000a5c7eac 0x000000001a0d963c 0x000000001a0d9539 0x000000001a0d90b9 0x000000001ad75935 0x000000001ad7293f 0x000000001ad59cca 0x000000001ad580a1 0x000000001ad62241 0x000000001ad548d9 0x000000001ad52914 0x000000001ad525d3 0x000000001ad43d46 0x000000001b1bdb2c 0x0
00000001b1bce98 0x000000001b1bf818 0x000000001b1bef4c 0x000000001b1beefd 0x000000001b1bee9d 0x000000001b1bee5d 0x000000001b1bee25 0x000000001b0daa7e 0x000000001b0d5ffd 0x000000001b0d568d 0x000000001b85d250 0x000000001b857d4a 0x000000001d11b7c0 0x000000001d1327e5 0x000000002172cd99 0x000000002172d5e8 0x0000000021904094 0x0000000021900e3a 0x00000000218ffb7e 0x00007fc2a1494ac3
2024.04.02 13:05:55.891775 [ 329632 ] {} <Fatal> BaseDaemon: 4. ? @ 0x00007fc2a14969fc
2024.04.02 13:05:55.891850 [ 329632 ] {} <Fatal> BaseDaemon: 5. ? @ 0x00007fc2a1442476
2024.04.02 13:05:55.891958 [ 329632 ] {} <Fatal> BaseDaemon: 6. ? @ 0x00007fc2a14287f3
2024.04.02 13:05:55.960419 [ 329632 ] {} <Fatal> BaseDaemon: 7. /home/ubuntu/repo/ch7/src/Common/Exception.cpp:0: DB::abortOnFailedAssertion(String const&) @ 0x0000000012f8c703
2024.04.02 13:05:56.005481 [ 328435 ] {} <Trace> AsynchronousMetrics: MemoryTracking: was 640.55 MiB, peak 116.97 GiB, free memory in arenas 43.50 MiB, will set to 669.56 MiB (RSS), difference: 29.01 MiB
2024.04.02 13:05:56.027512 [ 329632 ] {} <Fatal> BaseDaemon: 8. /home/ubuntu/repo/ch7/src/Common/Exception.cpp:63: DB::handle_error_code(String const&, int, bool, std::vector<void*, std::allocator<void*>> const&) @ 0x0000000012f8c875
2024.04.02 13:05:56.083235 [ 329632 ] {} <Fatal> BaseDaemon: 9. /home/ubuntu/repo/ch7/src/Common/Exception.cpp:100: DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x0000000012f8cdb1
2024.04.02 13:05:56.132762 [ 329632 ] {} <Fatal> BaseDaemon: 10. /home/ubuntu/repo/ch7/src/Common/Exception.h:90: DB::Exception::Exception(String&&, int, bool) @ 0x000000000a5c560a
2024.04.02 13:05:56.183431 [ 329632 ] {} <Fatal> BaseDaemon: 11. /home/ubuntu/repo/ch7/src/Common/Exception.h:109: DB::Exception::Exception<String, String>(int, FormatStringHelperImpl<std::type_identity<String>::type, std::type_identity<String>::type>, String&&, String&&) @ 0x000000000a5c7eac
2024.04.02 13:05:56.281722 [ 329632 ] {} <Fatal> BaseDaemon: 12. /home/ubuntu/repo/ch7/src/Common/typeid_cast.h:33: DB::IdentifierNode& typeid_cast<DB::IdentifierNode&, DB::IQueryTreeNode>(DB::IQueryTreeNode&) @ 0x000000001a0d963c
2024.04.02 13:05:56.378949 [ 329632 ] {} <Fatal> BaseDaemon: 13. /home/ubuntu/repo/ch7/src/Common/TypePromotion.h:26: DB::TypePromotion<DB::IQueryTreeNode>::CastHelper<DB::IdentifierNode&, false, true>::value(DB::IQueryTreeNode*) @ 0x000000001a0d9539
2024.04.02 13:05:56.475800 [ 329632 ] {} <Fatal> BaseDaemon: 14. /home/ubuntu/repo/ch7/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&>() @ 0x000000001a0d90b9
2024.04.02 13:05:56.876662 [ 329632 ] {} <Fatal> BaseDaemon: 15. /home/ubuntu/repo/ch7/src/Analyzer/Passes/QueryAnalysisPass.cpp:5185: 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&) @ 0x000000001ad75935
2024.04.02 13:05:57.005776 [ 328435 ] {} <Trace> AsynchronousMetrics: MemoryTracking: was 669.56 MiB, peak 116.97 GiB, free memory in arenas 43.48 MiB, will set to 764.56 MiB (RSS), difference: 95.00 MiB
2024.04.02 13:05:57.218551 [ 329632 ] {} <Fatal> BaseDaemon: 16. /home/ubuntu/repo/ch7/src/Analyzer/Passes/QueryAnalysisPass.cpp:5932: DB::(anonymous namespace)::QueryAnalyzer::resolveFunction(std::shared_ptr<DB::IQueryTreeNode>&, DB::(anonymous namespace)::IdentifierResolveScope&) @ 0x000000001ad7293f
2024.04.02 13:05:57.575496 [ 329632 ] {} <Fatal> BaseDaemon: 17. /home/ubuntu/repo/ch7/src/Analyzer/Passes/QueryAnalysisPass.cpp:6374: DB::(anonymous namespace)::QueryAnalyzer::resolveExpressionNode(std::shared_ptr<DB::IQueryTreeNode>&, DB::(anonymous namespace)::IdentifierResolveScope&, bool, bool) @ 0x000000001ad59cca
2024.04.02 13:05:57.937301 [ 329632 ] {} <Fatal> BaseDaemon: 18. /home/ubuntu/repo/ch7/src/Analyzer/Passes/QueryAnalysisPass.cpp:6509: DB::(anonymous namespace)::QueryAnalyzer::resolveExpressionNodeList(std::shared_ptr<DB::IQueryTreeNode>&, DB::(anonymous namespace)::IdentifierResolveScope&, bool, bool) @ 0x000000001ad580a1
2024.04.02 13:05:58.005783 [ 328435 ] {} <Trace> AsynchronousMetrics: MemoryTracking: was 764.56 MiB, peak 116.97 GiB, free memory in arenas 44.71 MiB, will set to 765.56 MiB (RSS), difference: 1.00 MiB
2024.04.02 13:05:58.306387 [ 329632 ] {} <Fatal> BaseDaemon: 19. /home/ubuntu/repo/ch7/src/Analyzer/Passes/QueryAnalysisPass.cpp:6720: DB::(anonymous namespace)::QueryAnalyzer::resolveGroupByNode(DB::QueryNode&, DB::(anonymous namespace)::IdentifierResolveScope&) @ 0x000000001ad62241
^C2024.04.02 13:05:58.325640 [ 327528 ] {} <Trace> BaseDaemon: Received signal 2
2024.04.02 13:05:58.325711 [ 327528 ] {} <Information> Application: Received termination signal (Interrupt)
2024.04.02 13:05:58.325884 [ 327527 ] {} <Debug> Application: Received termination signal.
2024.04.02 13:05:58.326609 [ 327527 ] {} <Debug> Application: Waiting for current connections to close.
2024.04.02 13:05:58.667199 [ 329632 ] {} <Fatal> BaseDaemon: 20. /home/ubuntu/repo/ch7/src/Analyzer/Passes/QueryAnalysisPass.cpp:8032: DB::(anonymous namespace)::QueryAnalyzer::resolveQuery(std::shared_ptr<DB::IQueryTreeNode> const&, DB::(anonymous namespace)::IdentifierResolveScope&) @ 0x000000001ad548d9
2024.04.02 13:05:59.005358 [ 328435 ] {} <Trace> AsynchronousMetrics: MemoryTracking: was 765.55 MiB, peak 116.97 GiB, free memory in arenas 42.21 MiB, will set to 763.71 MiB (RSS), difference: -1.83 MiB
2024.04.02 13:05:59.024083 [ 329632 ] {} <Fatal> BaseDaemon: 21. /home/ubuntu/repo/ch7/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>) @ 0x000000001ad52914
2024.04.02 13:05:59.380590 [ 329632 ] {} <Fatal> BaseDaemon: 22. /home/ubuntu/repo/ch7/src/Analyzer/Passes/QueryAnalysisPass.cpp:8227: DB::QueryAnalysisPass::run(std::shared_ptr<DB::IQueryTreeNode>&, std::shared_ptr<DB::Context const>) @ 0x000000001ad525d3
2024.04.02 13:05:59.389173 [ 327527 ] {} <Warning> Application: Closed all listening sockets. Waiting for 1 outstanding connections.
2024.04.02 13:05:59.450007 [ 329632 ] {} <Fatal> BaseDaemon: 23. /home/ubuntu/repo/ch7/src/Analyzer/QueryTreePassManager.cpp:186: DB::QueryTreePassManager::run(std::shared_ptr<DB::IQueryTreeNode>) @ 0x000000001ad43d46
2024.04.02 13:05:59.549388 [ 329632 ] {} <Fatal> BaseDaemon: 24. /home/ubuntu/repo/ch7/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&) @ 0x000000001b1bdb2c
2024.04.02 13:05:59.632909 [ 329632 ] {} <Fatal> BaseDaemon: 25. /home/ubuntu/repo/ch7/src/Interpreters/InterpreterSelectQueryAnalyzer.cpp:132: DB::InterpreterSelectQueryAnalyzer::InterpreterSelectQueryAnalyzer(std::shared_ptr<DB::IAST> const&, std::shared_ptr<DB::Context const> const&, DB::SelectQueryOptions const&) @ 0x000000001b1bce98

The performance failures (e.g. here) are unrelated.

Do you also like to take a look here which looks related (on the surface)? https://s3.amazonaws.com/clickhouse-test-reports/59318/5f786647fbc2c54dab9cd9885dffd4bfa4eec83a/ast_fuzzer__tsan_.html

The test failure of 00062_loyalty (here) looks also weird but it does not contain maps, so I assume it is unrelated.

Please also merge once more from master as lots of fixes for CI were merged in the meantime.

@pufit

pufit commented Apr 3, 2024

Copy link
Copy Markdown
Member

The same failure appears here.)

BTW, there is the same logical error in the master. Probably, it's related to the new analyzer being merged
https://s3.amazonaws.com/clickhouse-test-reports/0/0fe3046a985fe9ab566422ef10fae20fc5c4d8c4/ast_fuzzer__ubsan_.html

@taiyang-li

Copy link
Copy Markdown
Contributor Author

Do you also like to take a look here which looks related (on the surface)? https://s3.amazonaws.com/clickhouse-test-reports/59318/5f786647fbc2c54dab9cd9885dffd4bfa4eec83a/ast_fuzzer__tsan_.html

@rschu1ze I tried, but it could not be reproduced.

@rschu1ze

rschu1ze commented Apr 7, 2024

Copy link
Copy Markdown
Member

The same failure appears here.)

BTW, there is the same logical error in the master. Probably, it's related to the new analyzer being merged https://s3.amazonaws.com/clickhouse-test-reports/0/0fe3046a985fe9ab566422ef10fae20fc5c4d8c4/ast_fuzzer__ubsan_.html

SELECT tuple(mapSort(k -> k, map([toUInt128(4), 3, 1], materialize(toNullable(4)), [4], 5))), mapUpdate(map('k1', 1, toFixedString('k2', 2), 2), map(toFixedString('k1', 2), materialize(toLowCardinality(11)), 'k2', 22)) GROUP BY toUInt256(3), tuple(toNullable(1)), 1 WITH CUBE;

does not run in master but a minimized version which triggers the same error does:

SELECT tuple(mapSort(k -> k, map('a', 4))), mapUpdate(map('k1', 1), map('k2', 11)) GROUP BY 1 WITH CUBE;

Opened issue #62374.

There are still many analyzer-related failures :-( Let's wait a bit more until the CI situation is better.

@rschu1ze

Copy link
Copy Markdown
Member

@taiyang-li Like to merge from master again? (I don't have permissions to push to your fork, otherwise I would have done that by myself)

@rschu1ze

rschu1ze commented May 6, 2024

Copy link
Copy Markdown
Member

https://s3.amazonaws.com/clickhouse-test-reports/59318/c0ddd3df0bc37d0b842073fb247ef4f3b64d4a49/ast_fuzzer__ubsan_.html:

  • Logical error: 'Columns are assumed to be of identical types, but they are different in Nullable'..
  • This was caused by query SELECT 1, map((1, 2), materialize(4), (3, 4), 5), mapFilter((k, v) -> (k = (materialize(1), 2)), map((1, 2), toUInt256(4), (3, 4), 5)) GROUP BY tuple('b', 1, 1, materialize(1), toNullable(1), 1, toLowCardinality(1), toNullable(toNullable(1)), 1), CAST('0.1', 'Float32').
  • Running this query on master and on this PR did not reproduce the error. I did not find registered occurrences of this error, so it is a bit strange but I assume it is a one-hit-wonder.

I'll merge and keep an eye on the error.

@rschu1ze
rschu1ze added this pull request to the merge queue May 6, 2024
Merged via the queue into ClickHouse:master with commit a7ba895 May 6, 2024
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label May 6, 2024
@den-crane

Copy link
Copy Markdown
Contributor

@clickgapai

Copy link
Copy Markdown
Contributor

Hi @taiyang-li @rschu1ze — while reviewing this PR I found the following:

Happy to discuss — close anything that's wrong or already addressed.

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

Labels

pr-improvement Pull request with some product improvements pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support complex types as map key

8 participants