https://s3.amazonaws.com/clickhouse-test-reports/0/ad0d060dc1964703c4a837ed3f279481f206e363/fuzzer_astfuzzerubsan//report.html

```
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/DataTypes/DataTypesNumber.h:16:71 in
../src/DataTypes/DataTypesNumber.h:16:71: runtime error: dynamic operation on address 0x7f289ed1bcf8 which does not point to an object of type 'DB::IDataType'
0x7f289ed1bcf8: note: object is of type 'DB::ASTSelectWithUnionQuery'
 00 00 00 00  d8 84 68 0b 00 00 00 00  f8 bc d1 9e 28 7f 00 00  e0 bc d1 9e 28 7f 00 00  70 17 db 9d
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'DB::ASTSelectWithUnionQuery'
```

```
2022.08.08 14:21:28.844826 [ 470 ] {} <Fatal> BaseDaemon: ########################################
2022.08.08 14:21:28.844951 [ 470 ] {} <Fatal> BaseDaemon: (version 22.8.1.1 (official build), build id: F6CEBFA217617AAA) (from thread 205) (query_id: 26838b12-743e-45b6-b537-439614b8d481) (query: SELECT uniqMerge(x + y) FROM (SELECT uniqState(65536, a) AS x, uniqState(b) AS y FROM add_aggregate)) Received signal Unknown signal (-3)
2022.08.08 14:21:28.845001 [ 470 ] {} <Fatal> BaseDaemon: Sanitizer trap.
2022.08.08 14:21:28.845064 [ 470 ] {} <Fatal> BaseDaemon: Stack trace: 0x101c6831 0x1045c5f6 0x1017c7c6 0x101913cd 0x10ae966a 0x24867e79 0x1d26418b 0x1cf64325 0x16caeff8 0x24401d9a 0x2440151a 0x24401ef5 0x24c9fd67 0x251a192c 0x251b4fd4 0x251a768b 0x251ac4fc 0x2517e568 0x25163d2b 0x251642e6 0x25161411 0x25160757 0x2596c7b9 0x25972704 0x25944c2f 0x2593e729 0x2593a840 0x259be828 0x259bb14e 0x259b8c51 0x258e16ea 0x258dfe29 0x25dee6dd 0x25deb86d 0x26eeb2d0 0x26f0a6ba 0x27e37fec 0x27e384da 0x27fb2a87 0x27fb054f 0x7f2a2794e609 0x7f2a27873133
2022.08.08 14:21:28.853406 [ 470 ] {} <Fatal> BaseDaemon: 0.1. inlined from ./build_docker/../src/Common/StackTrace.cpp:331: StackTrace::tryCapture()
2022.08.08 14:21:28.853451 [ 470 ] {} <Fatal> BaseDaemon: 0. ../src/Common/StackTrace.cpp:292: StackTrace::StackTrace() in /workspace/clickhouse
2022.08.08 14:21:28.869465 [ 470 ] {} <Fatal> BaseDaemon: 1. ./build_docker/../src/Daemon/BaseDaemon.cpp:0: sanitizerDeathCallback() in /workspace/clickhouse
2022.08.08 14:21:29.811338 [ 470 ] {} <Fatal> BaseDaemon: 2. __sanitizer::Die() in /workspace/clickhouse
2022.08.08 14:21:30.736924 [ 470 ] {} <Fatal> BaseDaemon: 3. ? in /workspace/clickhouse
2022.08.08 14:21:30.764512 [ 470 ] {} <Fatal> BaseDaemon: 4. ./build_docker/../src/DataTypes/DataTypesNumber.h:16: DB::DataTypeNumber<unsigned int>::equals(DB::IDataType const&) const in /workspace/clickhouse
2022.08.08 14:21:30.778303 [ 470 ] {} <Fatal> BaseDaemon: 5. ./build_docker/../src/DataTypes/DataTypeAggregateFunction.cpp:0: DB::DataTypeAggregateFunction::equals(DB::IDataType const&) const in /workspace/clickhouse
2022.08.08 14:21:31.704603 [ 470 ] {} <Fatal> BaseDaemon: 6. DB::FunctionBinaryArithmetic<DB::PlusImpl, DB::NamePlus, true, true, false>::getReturnTypeImplStatic(std::__1::vector<std::__1::shared_ptr<DB::IDataType const>, std::__1::allocator<std::__1::shared_ptr<DB::IDataType const> > > const&, std::__1::shared_ptr<DB::Context const>) in /workspace/clickhouse
2022.08.08 14:21:32.630346 [ 470 ] {} <Fatal> BaseDaemon: 7. DB::BinaryArithmeticOverloadResolver<DB::PlusImpl, DB::NamePlus, true, true>::getReturnTypeImpl(std::__1::vector<std::__1::shared_ptr<DB::IDataType const>, std::__1::allocator<std::__1::shared_ptr<DB::IDataType const> > > const&) const in /workspace/clickhouse
2022.08.08 14:21:33.556130 [ 470 ] {} <Fatal> BaseDaemon: 8. DB::IFunctionOverloadResolver::getReturnTypeImpl(std::__1::vector<DB::ColumnWithTypeAndName, std::__1::allocator<DB::ColumnWithTypeAndName> > const&) const in /workspace/clickhouse
2022.08.08 14:21:33.569193 [ 470 ] {} <Fatal> BaseDaemon: 9. ./build_docker/../src/Functions/IFunction.cpp:478: DB::IFunctionOverloadResolver::getReturnTypeWithoutLowCardinality(std::__1::vector<DB::ColumnWithTypeAndName, std::__1::allocator<DB::ColumnWithTypeAndName> > const&) const in /workspace/clickhouse
2022.08.08 14:21:33.581793 [ 470 ] {} <Fatal> BaseDaemon: 10. ./build_docker/../src/Functions/IFunction.cpp:424: DB::IFunctionOverloadResolver::getReturnType(std::__1::vector<DB::ColumnWithTypeAndName, std::__1::allocator<DB::ColumnWithTypeAndName> > const&) const in /workspace/clickhouse
2022.08.08 14:21:33.594543 [ 470 ] {} <Fatal> BaseDaemon: 11. ./build_docker/../src/Functions/IFunction.cpp:439: DB::IFunctionOverloadResolver::build(std::__1::vector<DB::ColumnWithTypeAndName, std::__1::allocator<DB::ColumnWithTypeAndName> > const&) const in /workspace/clickhouse
2022.08.08 14:21:33.761061 [ 470 ] {} <Fatal> BaseDaemon: 12.1. inlined from ./build_docker/../contrib/libcxx/include/__memory/shared_ptr.h:617: shared_ptr
2022.08.08 14:21:33.761118 [ 470 ] {} <Fatal> BaseDaemon: 12.2. inlined from ../contrib/libcxx/include/__memory/shared_ptr.h:724: std::__1::shared_ptr<DB::IFunctionBase>::operator=(std::__1::shared_ptr<DB::IFunctionBase>&&)
2022.08.08 14:21:33.761146 [ 470 ] {} <Fatal> BaseDaemon: 12. ../src/Interpreters/ActionsDAG.cpp:189: DB::ActionsDAG::addFunction(std::__1::shared_ptr<DB::IFunctionOverloadResolver> const&, std::__1::vector<DB::ActionsDAG::Node const*, std::__1::allocator<DB::ActionsDAG::Node const*> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in /workspace/clickhouse
2022.08.08 14:21:33.810428 [ 470 ] {} <Fatal> BaseDaemon: 13. ./build_docker/../src/Interpreters/ActionsVisitor.cpp:0: DB::ScopeStack::addFunction(std::__1::shared_ptr<DB::IFunctionOverloadResolver> const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in /workspace/clickhouse
2022.08.08 14:21:33.862617 [ 470 ] {} <Fatal> BaseDaemon: 14.1. inlined from ./build_docker/../contrib/libcxx/include/string:1445: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__is_long() const
2022.08.08 14:21:33.862666 [ 470 ] {} <Fatal> BaseDaemon: 14.2. inlined from ../contrib/libcxx/include/string:2231: ~basic_string
2022.08.08 14:21:33.862695 [ 470 ] {} <Fatal> BaseDaemon: 14. ../src/Interpreters/ActionsVisitor.h:185: DB::ActionsMatcher::Data::addFunction(std::__1::shared_ptr<DB::IFunctionOverloadResolver> const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in /workspace/clickhouse
2022.08.08 14:21:33.912483 [ 470 ] {} <Fatal> BaseDaemon: 15. ./build_docker/../src/Interpreters/ActionsVisitor.cpp:0: DB::ActionsMatcher::visit(DB::ASTFunction const&, std::__1::shared_ptr<DB::IAST> const&, DB::ActionsMatcher::Data&) in /workspace/clickhouse
2022.08.08 14:21:33.963703 [ 470 ] {} <Fatal> BaseDaemon: 16. ./build_docker/../contrib/libcxx/include/vector:0: DB::ActionsMatcher::visit(DB::ASTExpressionList&, std::__1::shared_ptr<DB::IAST> const&, DB::ActionsMatcher::Data&) in /workspace/clickhouse
2022.08.08 14:21:34.019944 [ 470 ] {} <Fatal> BaseDaemon: 17. ./build_docker/../src/Interpreters/InDepthNodeVisitor.h:43: DB::InDepthNodeVisitor<DB::ActionsMatcher, true, false, std::__1::shared_ptr<DB::IAST> const>::visit(std::__1::shared_ptr<DB::IAST> const&) in /workspace/clickhouse
2022.08.08 14:21:34.072811 [ 470 ] {} <Fatal> BaseDaemon: 18.1. inlined from ./build_docker/../src/Interpreters/ActionsVisitor.h:190: DB::ActionsMatcher::Data::getActions()
2022.08.08 14:21:34.072846 [ 470 ] {} <Fatal> BaseDaemon: 18. ../src/Interpreters/ExpressionAnalyzer.cpp:572: DB::ExpressionAnalyzer::getRootActionsNoMakeSet(std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::ActionsDAG>&, bool) in /workspace/clickhouse
2022.08.08 14:21:34.126421 [ 470 ] {} <Fatal> BaseDaemon: 19. ./build_docker/../src/Interpreters/ExpressionAnalyzer.cpp:628: DB::ExpressionAnalyzer::makeAggregateDescriptions(std::__1::shared_ptr<DB::ActionsDAG>&, std::__1::vector<DB::AggregateDescription, std::__1::allocator<DB::AggregateDescription> >&) in /workspace/clickhouse
2022.08.08 14:21:34.178711 [ 470 ] {} <Fatal> BaseDaemon: 20.1. inlined from ./build_docker/../contrib/libcxx/include/vector:511: std::__1::vector<DB::AggregateDescription, std::__1::allocator<DB::AggregateDescription> >::empty() const
2022.08.08 14:21:34.178762 [ 470 ] {} <Fatal> BaseDaemon: 20. ../src/Interpreters/ExpressionAnalyzer.cpp:254: DB::ExpressionAnalyzer::analyzeAggregation(std::__1::shared_ptr<DB::ActionsDAG>&) in /workspace/clickhouse
2022.08.08 14:21:34.230117 [ 470 ] {} <Fatal> BaseDaemon: 21. ./build_docker/../src/Interpreters/ExpressionAnalyzer.cpp:0: DB::ExpressionAnalyzer::ExpressionAnalyzer(std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::TreeRewriterResult const> const&, std::__1::shared_ptr<DB::Context const>, unsigned long, bool, bool, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, DB::SubqueryForSet, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, DB::SubqueryForSet> > >, std::__1::unordered_map<DB::PreparedSetKey, std::__1::shared_ptr<DB::Set>, DB::PreparedSetKey::Hash, std::__1::equal_to<DB::PreparedSetKey>, std::__1::allocator<std::__1::pair<DB::PreparedSetKey const, std::__1::shared_ptr<DB::Set> > > >) in /workspace/clickhouse
2022.08.08 14:21:34.309070 [ 470 ] {} <Fatal> BaseDaemon: 22. ./build_docker/../src/Interpreters/ExpressionAnalyzer.h:322: DB::SelectQueryExpressionAnalyzer::SelectQueryExpressionAnalyzer(std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::TreeRewriterResult const> const&, std::__1::shared_ptr<DB::Context const>, std::__1::shared_ptr<DB::StorageInMemoryMetadata const> const&, std::__1::unordered_set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, bool, DB::SelectQueryOptions const&, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, DB::SubqueryForSet, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, DB::SubqueryForSet> > >, std::__1::unordered_map<DB::PreparedSetKey, std::__1::shared_ptr<DB::Set>, DB::PreparedSetKey::Hash, std::__1::equal_to<DB::PreparedSetKey>, std::__1::allocator<std::__1::pair<DB::PreparedSetKey const, std::__1::shared_ptr<DB::Set> > > >) in /workspace/clickhouse
2022.08.08 14:21:34.477517 [ 470 ] {} <Fatal> BaseDaemon: 23. ./build_docker/../contrib/libcxx/include/__memory/unique_ptr.h:725: std::__1::__unique_if<DB::SelectQueryExpressionAnalyzer>::__unique_single std::__1::make_unique<DB::SelectQueryExpressionAnalyzer, std::__1::shared_ptr<DB::IAST>&, std::__1::shared_ptr<DB::TreeRewriterResult const>&, std::__1::shared_ptr<DB::Context>&, std::__1::shared_ptr<DB::StorageInMemoryMetadata const>&, std::__1::unordered_set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, bool, DB::SelectQueryOptions&, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, DB::SubqueryForSet, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, DB::SubqueryForSet> > >, std::__1::unordered_map<DB::PreparedSetKey, std::__1::shared_ptr<DB::Set>, DB::PreparedSetKey::Hash, std::__1::equal_to<DB::PreparedSetKey>, std::__1::allocator<std::__1::pair<DB::PreparedSetKey const, std::__1::shared_ptr<DB::Set> > > > >(std::__1::shared_ptr<DB::IAST>&, std::__1::shared_ptr<DB::TreeRewriterResult const>&, std::__1::shared_ptr<DB::Context>&, std::__1::shared_ptr<DB::StorageInMemoryMetadata const>&, std::__1::unordered_set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&&, bool&&, DB::SelectQueryOptions&, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, DB::SubqueryForSet, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, DB::SubqueryForSet> > >&&, std::__1::unordered_map<DB::PreparedSetKey, std::__1::shared_ptr<DB::Set>, DB::PreparedSetKey::Hash, std::__1::equal_to<DB::PreparedSetKey>, std::__1::allocator<std::__1::pair<DB::PreparedSetKey const, std::__1::shared_ptr<DB::Set> > > >&&) in /workspace/clickhouse
2022.08.08 14:21:34.558970 [ 470 ] {} <Fatal> BaseDaemon: 24. ./build_docker/../src/Interpreters/InterpreterSelectQuery.cpp:561: DB::InterpreterSelectQuery::InterpreterSelectQuery(std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::Context> const&, std::__1::optional<DB::Pipe>, std::__1::shared_ptr<DB::IStorage> const&, DB::SelectQueryOptions const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::shared_ptr<DB::StorageInMemoryMetadata const> const&, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, DB::SubqueryForSet, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, DB::SubqueryForSet> > >, std::__1::unordered_map<DB::PreparedSetKey, std::__1::shared_ptr<DB::Set>, DB::PreparedSetKey::Hash, std::__1::equal_to<DB::PreparedSetKey>, std::__1::allocator<std::__1::pair<DB::PreparedSetKey const, std::__1::shared_ptr<DB::Set> > > >)::$_1::operator()(bool) const in /workspace/clickhouse
2022.08.08 14:21:34.637320 [ 470 ] {} <Fatal> BaseDaemon: 25. ./build_docker/../src/Interpreters/InterpreterSelectQuery.cpp:0: DB::InterpreterSelectQuery::InterpreterSelectQuery(std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::Context> const&, std::__1::optional<DB::Pipe>, std::__1::shared_ptr<DB::IStorage> const&, DB::SelectQueryOptions const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::shared_ptr<DB::StorageInMemoryMetadata const> const&, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, DB::SubqueryForSet, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, DB::SubqueryForSet> > >, std::__1::unordered_map<DB::PreparedSetKey, std::__1::shared_ptr<DB::Set>, DB::PreparedSetKey::Hash, std::__1::equal_to<DB::PreparedSetKey>, std::__1::allocator<std::__1::pair<DB::PreparedSetKey const, std::__1::shared_ptr<DB::Set> > > >) in /workspace/clickhouse
2022.08.08 14:21:34.715804 [ 470 ] {} <Fatal> BaseDaemon: 26. ./build_docker/../src/Interpreters/InterpreterSelectQuery.cpp:191: DB::InterpreterSelectQuery::InterpreterSelectQuery(std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::Context> const&, DB::SelectQueryOptions const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) in /workspace/clickhouse
2022.08.08 14:21:34.749818 [ 470 ] {} <Fatal> BaseDaemon: 27. ./build_docker/../contrib/libcxx/include/__memory/unique_ptr.h:725: std::__1::__unique_if<DB::InterpreterSelectQuery>::__unique_single std::__1::make_unique<DB::InterpreterSelectQuery, std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::Context>&, DB::SelectQueryOptions&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&>(std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::Context>&, DB::SelectQueryOptions&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) in /workspace/clickhouse
2022.08.08 14:21:34.777425 [ 470 ] {} <Fatal> BaseDaemon: 28.1. inlined from ./build_docker/../contrib/libcxx/include/__memory/compressed_pair.h:48: __compressed_pair_elem<DB::InterpreterSelectQuery *, void>
2022.08.08 14:21:34.777461 [ 470 ] {} <Fatal> BaseDaemon: 28.2. inlined from ../contrib/libcxx/include/__memory/compressed_pair.h:130: __compressed_pair<DB::InterpreterSelectQuery *, std::__1::default_delete<DB::InterpreterSelectQuery> >
2022.08.08 14:21:34.777478 [ 470 ] {} <Fatal> BaseDaemon: 28.3. inlined from ../contrib/libcxx/include/__memory/unique_ptr.h:220: unique_ptr<DB::InterpreterSelectQuery, std::__1::default_delete<DB::InterpreterSelectQuery>, void, void>
2022.08.08 14:21:34.777502 [ 470 ] {} <Fatal> BaseDaemon: 28. ../src/Interpreters/InterpreterSelectWithUnionQuery.cpp:244: DB::InterpreterSelectWithUnionQuery::buildCurrentChildInterpreter(std::__1::shared_ptr<DB::IAST> const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) in /workspace/clickhouse
2022.08.08 14:21:34.804109 [ 470 ] {} <Fatal> BaseDaemon: 29. ./build_docker/../src/Interpreters/InterpreterSelectWithUnionQuery.cpp:0: DB::InterpreterSelectWithUnionQuery::InterpreterSelectWithUnionQuery(std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::Context>, DB::SelectQueryOptions const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) in /workspace/clickhouse
2022.08.08 14:21:34.817385 [ 470 ] {} <Fatal> BaseDaemon: 30. ./build_docker/../contrib/libcxx/include/__memory/unique_ptr.h:0: std::__1::__unique_if<DB::InterpreterSelectWithUnionQuery>::__unique_single std::__1::make_unique<DB::InterpreterSelectWithUnionQuery, std::__1::shared_ptr<DB::IAST>&, std::__1::shared_ptr<DB::Context>&, DB::SelectQueryOptions const&>(std::__1::shared_ptr<DB::IAST>&, std::__1::shared_ptr<DB::Context>&, DB::SelectQueryOptions const&) in /workspace/clickhouse
2022.08.08 14:21:34.828846 [ 470 ] {} <Fatal> BaseDaemon: 31.1. inlined from ./build_docker/../contrib/libcxx/include/__memory/compressed_pair.h:48: __compressed_pair_elem<DB::InterpreterSelectWithUnionQuery *, void>
2022.08.08 14:21:34.828876 [ 470 ] {} <Fatal> BaseDaemon: 31.2. inlined from ../contrib/libcxx/include/__memory/compressed_pair.h:130: __compressed_pair<DB::InterpreterSelectWithUnionQuery *, std::__1::default_delete<DB::InterpreterSelectWithUnionQuery> >
2022.08.08 14:21:34.828901 [ 470 ] {} <Fatal> BaseDaemon: 31.3. inlined from ../contrib/libcxx/include/__memory/unique_ptr.h:220: unique_ptr<DB::InterpreterSelectWithUnionQuery, std::__1::default_delete<DB::InterpreterSelectWithUnionQuery>, void, void>
2022.08.08 14:21:34.828924 [ 470 ] {} <Fatal> BaseDaemon: 31. ../src/Interpreters/InterpreterFactory.cpp:130: DB::InterpreterFactory::get(std::__1::shared_ptr<DB::IAST>&, std::__1::shared_ptr<DB::Context>, DB::SelectQueryOptions const&) in /workspace/clickhouse
2022.08.08 14:21:34.872927 [ 470 ] {} <Fatal> BaseDaemon: 32. ./build_docker/../src/Interpreters/executeQuery.cpp:648: DB::executeQueryImpl(char const*, char const*, std::__1::shared_ptr<DB::Context>, bool, DB::QueryProcessingStage::Enum, DB::ReadBuffer*) in /workspace/clickhouse
2022.08.08 14:21:34.919989 [ 470 ] {} <Fatal> BaseDaemon: 33. ./build_docker/../src/Interpreters/executeQuery.cpp:1085: DB::executeQuery(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<DB::Context>, bool, DB::QueryProcessingStage::Enum) in /workspace/clickhouse
2022.08.08 14:21:34.958584 [ 470 ] {} <Fatal> BaseDaemon: 34. ./build_docker/../src/Server/TCPHandler.cpp:336: DB::TCPHandler::runImpl() in /workspace/clickhouse
2022.08.08 14:21:35.006183 [ 470 ] {} <Fatal> BaseDaemon: 35. ./build_docker/../src/Server/TCPHandler.cpp:1827: DB::TCPHandler::run() in /workspace/clickhouse
2022.08.08 14:21:35.010130 [ 470 ] {} <Fatal> BaseDaemon: 36. ./build_docker/../contrib/poco/Net/src/TCPServerConnection.cpp:57: Poco::Net::TCPServerConnection::start() in /workspace/clickhouse
2022.08.08 14:21:35.016437 [ 470 ] {} <Fatal> BaseDaemon: 37.1. inlined from ./build_docker/../contrib/libcxx/include/__memory/unique_ptr.h:54: std::__1::default_delete<Poco::Net::TCPServerConnection>::operator()(Poco::Net::TCPServerConnection*) const
2022.08.08 14:21:35.016473 [ 470 ] {} <Fatal> BaseDaemon: 37.2. inlined from ../contrib/libcxx/include/__memory/unique_ptr.h:315: std::__1::unique_ptr<Poco::Net::TCPServerConnection, std::__1::default_delete<Poco::Net::TCPServerConnection> >::reset(Poco::Net::TCPServerConnection*)
2022.08.08 14:21:35.016493 [ 470 ] {} <Fatal> BaseDaemon: 37.3. inlined from ../contrib/libcxx/include/__memory/unique_ptr.h:269: ~unique_ptr
2022.08.08 14:21:35.016519 [ 470 ] {} <Fatal> BaseDaemon: 37. ../contrib/poco/Net/src/TCPServerDispatcher.cpp:116: Poco::Net::TCPServerDispatcher::run() in /workspace/clickhouse
2022.08.08 14:21:35.023024 [ 470 ] {} <Fatal> BaseDaemon: 38. ./build_docker/../contrib/poco/Foundation/src/ThreadPool.cpp:213: Poco::PooledThread::run() in /workspace/clickhouse
2022.08.08 14:21:35.029398 [ 470 ] {} <Fatal> BaseDaemon: 39.1. inlined from ./build_docker/../contrib/poco/Foundation/include/Poco/SharedPtr.h:156: Poco::SharedPtr<Poco::Runnable, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::Runnable> >::assign(Poco::Runnable*)
2022.08.08 14:21:35.029435 [ 470 ] {} <Fatal> BaseDaemon: 39.2. inlined from ../contrib/poco/Foundation/include/Poco/SharedPtr.h:208: Poco::SharedPtr<Poco::Runnable, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::Runnable> >::operator=(Poco::Runnable*)
2022.08.08 14:21:35.029452 [ 470 ] {} <Fatal> BaseDaemon: 39. ../contrib/poco/Foundation/src/Thread_POSIX.cpp:360: Poco::ThreadImpl::runnableEntry(void*) in /workspace/clickhouse
2022.08.08 14:21:35.029478 [ 470 ] {} <Fatal> BaseDaemon: 40. ? in ?
2022.08.08 14:21:35.029505 [ 470 ] {} <Fatal> BaseDaemon: 41. __clone in ?
2022.08.08 14:21:35.343870 [ 470 ] {} <Fatal> BaseDaemon: Integrity check of the executable successfully passed (checksum: 5F0522A9918760AC6878CACB78C00713)
```
* it is parametric, or [ASTIdentifier, types...] - otherwise. If aggregate function has version in AST, then it will be:
     * [ASTLiteral, ASTFunction (or ASTIdentifier), types...].
     */
    if (auto * version_ast = arguments->children[0]->as<ASTLiteral>())
    {
        if (arguments->children.size() < 2)
            throw Exception(ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH,
                "Data type AggregateFunction has version, but it requires at least one more parameter - name of aggregate function");
        version = version_ast->value.safeGet<UInt64>();
        data_type_ast = arguments->children[1];
        argument_types_start_idx = 2;
    }
    if (const auto * parametric = data_type_ast->as<ASTFunction>())
    {
        if (parametric->parameters)
            throw Exception("Unexpected level of parameters to aggregate function", ErrorCodes::SYNTAX_ERROR);
        function_name = parametric->name;
        if (parametric->arguments)
        {
            const ASTs & parameters = parametric->arguments->children;
            params_row.resize(parameters.size());
            for (size_t i = 0; i < parameters.size(); ++i)
            {
                const auto * literal = parameters[i]->as<ASTLiteral>();
                if (!literal)
                    throw Exception(
                        ErrorCodes::PARAMETERS_TO_AGGREGATE_FUNCTIONS_MUST_BE_LITERALS,
                        "Parameters to aggregate functions must be literals. "
                        "Got parameter '{}' for function '{}'",
                        parameters[i]->formatForErrorMessage(), function_name);