```
SELECT arrayStringConcat(groupArray(s), '\n:::::::\n\n:::::::\n'), count(), toUUID(NULL = NULL, NULL, toUUID(NULL = 1023, 2., NULL = NULL, NULL = NULL), NULL = 65535), wordShingleSimHash(s, 9223372036854775807) AS h FROM defaults GROUP BY toUUID(toUUID(NULL = 65535), 257, NULL = -1, 100.0000991821289, 100.0000991821289, NULL = 1), h)
```

```
2021.01.06 02:43:41.908784 [ 64 ] {46f41aee-67b4-42ac-a399-6b8b884afb68} <Error> executeQuery: std::exception. Code: 1001, type: std::length_error, e.what() = allocator<T>::allocate(size_t n) 'n' exceeds maximum supported size (version 20.13.1.5602) (from [::1]:53678) (in query: SELECT arrayStringConcat(groupArray(s), '\n:::::::\n\n:::::::\n'), count(), toUUID(NULL = NULL, NULL, toUUID(NULL = 1023, 2., NULL = NULL, NULL = NULL), NULL = 65535), wordShingleSimHash(s, 9223372036854775807) AS h FROM defaults GROUP BY toUUID(toUUID(NULL = 65535), 257, NULL = -1, 100.0000991821289, 100.0000991821289, NULL = 1), h), Stack trace (when copying this message, always include the lines below):

0. ./obj-x86_64-linux-gnu/../contrib/libcxx/include/exception:129: std::exception::capture() @ 0x1195c0a8 in /workspace/clickhouse
1. ./obj-x86_64-linux-gnu/../contrib/libcxx/include/exception:109: std::exception::exception() @ 0x1195c075 in /workspace/clickhouse
2. ./obj-x86_64-linux-gnu/../contrib/libcxx/src/support/runtime/stdexcept_default.ipp:24: std::logic_error::logic_error(char const*) @ 0x221a2a20 in /workspace/clickhouse
3. ./obj-x86_64-linux-gnu/../contrib/libcxx/include/stdexcept:153: std::length_error::length_error(char const*) @ 0x119317d7 in /workspace/clickhouse
4. ./obj-x86_64-linux-gnu/../contrib/libcxx/include/stdexcept:251: std::__1::__throw_length_error(char const*) @ 0x11931769 in /workspace/clickhouse
5. ./obj-x86_64-linux-gnu/../contrib/libcxx/include/memory:1864: std::__1::allocator<DB::BytesRef>::allocate(unsigned long, void const*) @ 0x1471d061 in /workspace/clickhouse
6. ./obj-x86_64-linux-gnu/../contrib/libcxx/include/memory:1581: std::__1::allocator_traits<std::__1::allocator<DB::BytesRef> >::allocate(std::__1::allocator<DB::BytesRef>&, unsigned long) @ 0x1471cf71 in /workspace/clickhouse
7. ./obj-x86_64-linux-gnu/../contrib/libcxx/include/__split_buffer:318: std::__1::__split_buffer<DB::BytesRef, std::__1::allocator<DB::BytesRef>&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<DB::BytesRef>&) @ 0x1471cc42 in /workspace/clickhouse
8. ./obj-x86_64-linux-gnu/../contrib/libcxx/include/vector:1586: std::__1::vector<DB::BytesRef, std::__1::allocator<DB::BytesRef> >::reserve(unsigned long) @ 0x1471c85e in /workspace/clickhouse
9. ./obj-x86_64-linux-gnu/../src/Functions/FunctionsStringHash.cpp:247: DB::SimHashImpl<false, false, false>::apply(DB::PODArray<char8_t, 4096ul, Allocator<false, false>, 15ul, 16ul> const&, DB::PODArray<unsigned long, 4096ul, Allocator<false, false>, 15ul, 16ul> const&, unsigned long, DB::PODArray<unsigned long, 4096ul, Allocator<false, false>, 15ul, 16ul>&) @ 0x1471b621 in /workspace/clickhouse
10. ./obj-x86_64-linux-gnu/../src/Functions/FunctionsStringHash.h:144: DB::FunctionsStringHash<DB::SimHashImpl<false, false, false>, DB::NameWordShingleSimHash, true, false>::executeImpl(std::__1::vector<DB::ColumnWithTypeAndName, std::__1::allocator<DB::ColumnWithTypeAndName> > const&, std::__1::shared_ptr<DB::IDataType const> const&, unsigned long) const @ 0x1471a91c in /workspace/clickhouse
11. ./obj-x86_64-linux-gnu/../src/Functions/IFunctionAdaptors.h:154: DB::DefaultExecutable::execute(std::__1::vector<DB::ColumnWithTypeAndName, std::__1::allocator<DB::ColumnWithTypeAndName> > const&, std::__1::shared_ptr<DB::IDataType const> const&, unsigned long) const @ 0x13b9a80e in /workspace/clickhouse
12. ./obj-x86_64-linux-gnu/../src/Functions/IFunction.cpp:293: DB::ExecutableFunctionAdaptor::executeWithoutLowCardinalityColumns(std::__1::vector<DB::ColumnWithTypeAndName, std::__1::allocator<DB::ColumnWithTypeAndName> > const&, std::__1::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x13ba0b33 in /workspace/clickhouse
13. ./obj-x86_64-linux-gnu/../src/Functions/IFunction.cpp:448: DB::ExecutableFunctionAdaptor::execute(std::__1::vector<DB::ColumnWithTypeAndName, std::__1::allocator<DB::ColumnWithTypeAndName> > const&, std::__1::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x13ba1ad5 in /workspace/clickhouse
14. ./obj-x86_64-linux-gnu/../src/Interpreters/ExpressionActions.cpp:333: DB::executeAction(DB::ExpressionActions::Action const&, DB::(anonymous namespace)::ExecutionContext&, bool) @ 0x1abf07a2 in /workspace/clickhouse
15. ./obj-x86_64-linux-gnu/../src/Interpreters/ExpressionActions.cpp:449: DB::ExpressionActions::execute(DB::Block&, unsigned long&, bool) const @ 0x1abeff16 in /workspace/clickhouse
16. ./obj-x86_64-linux-gnu/../src/Processors/Transforms/ExpressionTransform.cpp:25: DB::ExpressionTransform::transform(DB::Chunk&) @ 0x1c3b2099 in /workspace/clickhouse
17. ./obj-x86_64-linux-gnu/../src/Processors/ISimpleTransform.h:43: DB::ISimpleTransform::transform(DB::Chunk&, DB::Chunk&) @ 0x1b922195 in /workspace/clickhouse
18. ./obj-x86_64-linux-gnu/../src/Processors/ISimpleTransform.cpp:89: DB::ISimpleTransform::work() @ 0x1c108d98 in /workspace/clickhouse
19. ./obj-x86_64-linux-gnu/../src/Processors/Executors/PipelineExecutor.cpp:79: DB::executeJob(DB::IProcessor*) @ 0x1c16f8dc in /workspace/clickhouse
20. ./obj-x86_64-linux-gnu/../src/Processors/Executors/PipelineExecutor.cpp:96: DB::PipelineExecutor::addJob(DB::ExecutingGraph::Node*)::$_0::operator()() const @ 0x1c16f83f in /workspace/clickhouse
21. ./obj-x86_64-linux-gnu/../contrib/libcxx/include/type_traits:3519: decltype(std::__1::forward<DB::PipelineExecutor::addJob(DB::ExecutingGraph::Node*)::$_0&>(fp)()) std::__1::__invoke<DB::PipelineExecutor::addJob(DB::ExecutingGraph::Node*)::$_0&>(DB::PipelineExecutor::addJob(DB::ExecutingGraph::Node*)::$_0&) @ 0x1c16f7fd in /workspace/clickhouse
22. ./obj-x86_64-linux-gnu/../contrib/libcxx/include/__functional_base:349: void std::__1::__invoke_void_return_wrapper<void>::__call<DB::PipelineExecutor::addJob(DB::ExecutingGraph::Node*)::$_0&>(DB::PipelineExecutor::addJob(DB::ExecutingGraph::Node*)::$_0&) @ 0x1c16f7ad in /workspace/clickhouse
23. ./obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:1540: std::__1::__function::__alloc_func<DB::PipelineExecutor::addJob(DB::ExecutingGraph::Node*)::$_0, std::__1::allocator<DB::PipelineExecutor::addJob(DB::ExecutingGraph::Node*)::$_0>, void ()>::operator()() @ 0x1c16f77d in /workspace/clickhouse
24. ./obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:1714: std::__1::__function::__func<DB::PipelineExecutor::addJob(DB::ExecutingGraph::Node*)::$_0, std::__1::allocator<DB::PipelineExecutor::addJob(DB::ExecutingGraph::Node*)::$_0>, void ()>::operator()() @ 0x1c16e8de in /workspace/clickhouse
25. ./obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:1867: std::__1::__function::__value_func<void ()>::operator()() const @ 0x1197f235 in /workspace/clickhouse
26. ./obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:2473: std::__1::function<void ()>::operator()() const @ 0x1197e4c5 in /workspace/clickhouse
27. ./obj-x86_64-linux-gnu/../src/Processors/Executors/PipelineExecutor.cpp:583: DB::PipelineExecutor::executeStepImpl(unsigned long, unsigned long, std::__1::atomic<bool>*) @ 0x1c16d01d in /workspace/clickhouse
28. ./obj-x86_64-linux-gnu/../src/Processors/Executors/PipelineExecutor.cpp:473: DB::PipelineExecutor::executeSingleThread(unsigned long, unsigned long) @ 0x1c16d9e9 in /workspace/clickhouse
29. ./obj-x86_64-linux-gnu/../src/Processors/Executors/PipelineExecutor.cpp:807: DB::PipelineExecutor::executeImpl(unsigned long) @ 0x1c16b951 in /workspace/clickhouse
30. ./obj-x86_64-linux-gnu/../src/Processors/Executors/PipelineExecutor.cpp:395: DB::PipelineExecutor::execute(unsigned long) @ 0x1c16acb6 in /workspace/clickhouse
31. ./obj-x86_64-linux-gnu/../src/Processors/Executors/PullingAsyncPipelineExecutor.cpp:79: DB::threadFunction(DB::PullingAsyncPipelineExecutor::Data&, std::__1::shared_ptr<DB::ThreadGroupStatus>, unsigned long) @ 0x1c189737 in /workspace/clickhouse
```
{
        if (arguments.empty())
            throw Exception(ErrorCodes::TOO_FEW_ARGUMENTS_FOR_FUNCTION, "Function {} expect at least one argument", getName());
        if (!isString(arguments[0].type))
            throw Exception(ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT,
                            "First argument of function {} must be String, got {}", getName(), arguments[0].type->getName());
        size_t shingle_size = default_shingle_size;
        if (arguments.size() > 1)
        {
            if (!isUnsignedInteger(arguments[1].type))
                throw Exception(ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT,
                                "Second argument (shingle size) of function {} must be unsigned integer, got {}",
                                getName(), arguments[1].type->getName());
            if (!arguments[1].column)
                throw Exception(ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT,
                                "Second argument (shingle size) of function {} must be constant", getName());
            shingle_size = arguments[1].column->getUInt(0);
        }
        size_t num_hashes = default_num_hashes;
        if (arguments.size() > 2)
        {
            if constexpr (is_simhash)
                throw Exception(ErrorCodes::TOO_MANY_ARGUMENTS_FOR_FUNCTION,
                                "Function {} expect no more than two arguments (text, shingle size), got {}",
                                getName(), arguments.size());
            if (!isUnsignedInteger(arguments[2].type))
                throw Exception(ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT,