ClickHouse terminates on executing - version `22.8.1.1917`

`SELECT * FROM url('https://datahub.io/core/geo-countries/r/0.geojson', JSONAsObject)`

works as expected with JSONAsString


```
2022.08.18 08:54:45.969150 [ 459927 ] {} <Fatal> BaseDaemon: 16.1. inlined from ./build_docker/../contrib/libcxx/include/vector:931: std::__1::vector<COW<DB::IColumn>::immutable_ptr<DB::IColumn>, std::__1::allocator<COW<DB::IColumn>::immutable_ptr<DB::IColumn> > >::__vdeallocate()
2022.08.18 08:54:45.969209 [ 459927 ] {} <Fatal> BaseDaemon: 16.2. inlined from ../contrib/libcxx/include/vector:1275: std::__1::vector<COW<DB::IColumn>::immutable_ptr<DB::IColumn>, std::__1::allocator<COW<DB::IColumn>::immutable_ptr<DB::IColumn> > >::__move_assign(std::__1::vector<COW<DB::IColumn>::immutable_ptr<DB::IColumn>, std::__1::allocator<COW<DB::IColumn>::immutable_ptr<DB::IColumn> > >&, std::__1::integral_constant<bool, true>)
2022.08.18 08:54:45.969248 [ 459927 ] {} <Fatal> BaseDaemon: 16.3. inlined from ../contrib/libcxx/include/vector:1251: std::__1::vector<COW<DB::IColumn>::immutable_ptr<DB::IColumn>, std::__1::allocator<COW<DB::IColumn>::immutable_ptr<DB::IColumn> > >::operator=(std::__1::vector<COW<DB::IColumn>::immutable_ptr<DB::IColumn>, std::__1::allocator<COW<DB::IColumn>::immutable_ptr<DB::IColumn> > >&&)
2022.08.18 08:54:45.969273 [ 459927 ] {} <Fatal> BaseDaemon: 16.4. inlined from ../src/Processors/Chunk.h:53: DB::Chunk::operator=(DB::Chunk&&)
2022.08.18 08:54:45.969291 [ 459927 ] {} <Fatal> BaseDaemon: 16. ../src/Processors/Formats/Impl/ParallelParsingInputFormat.cpp:91: DB::ParallelParsingInputFormat::parserThreadFunction(std::__1::shared_ptr<DB::ThreadGroupStatus>, unsigned long) @ 0x15dea232 in /var/lib/clickhouse/clickhouse
2022.08.18 08:54:45.996892 [ 459927 ] {} <Fatal> BaseDaemon: 17.1. inlined from ./build_docker/../contrib/libcxx/include/__functional/function.h:832: std::__1::__function::__policy_func<void ()>::operator=(std::nullptr_t)
2022.08.18 08:54:45.996940 [ 459927 ] {} <Fatal> BaseDaemon: 17.2. inlined from ../contrib/libcxx/include/__functional/function.h:1157: std::__1::function<void ()>::operator=(std::nullptr_t)
2022.08.18 08:54:45.996963 [ 459927 ] {} <Fatal> BaseDaemon: 17. ../src/Common/ThreadPool.cpp:284: ThreadPoolImpl<ThreadFromGlobalPool>::worker(std::__1::__list_iterator<ThreadFromGlobalPool, void*>) @ 0xa440b28 in /var/lib/clickhouse/clickhouse
2022.08.18 08:54:46.025058 [ 459927 ] {} <Fatal> BaseDaemon: 18.1. inlined from ./build_docker/../src/Common/ThreadPool.cpp:0: operator()
2022.08.18 08:54:46.025110 [ 459927 ] {} <Fatal> BaseDaemon: 18.2. inlined from ../contrib/libcxx/include/type_traits:3640: decltype(static_cast<void>(fp)()) std::__1::__invoke<ThreadFromGlobalPool::ThreadFromGlobalPool<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>(void&&)::'lambda'()&>(void&&)
2022.08.18 08:54:46.025144 [ 459927 ] {} <Fatal> BaseDaemon: 18.3. inlined from ../contrib/libcxx/include/__functional/invoke.h:61: void std::__1::__invoke_void_return_wrapper<void, true>::__call<ThreadFromGlobalPool::ThreadFromGlobalPool<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>(void&&)::'lambda'()&>(ThreadFromGlobalPool::ThreadFromGlobalPool<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>(void&&)::'lambda'()&)
2022.08.18 08:54:46.025176 [ 459927 ] {} <Fatal> BaseDaemon: 18.4. inlined from ../contrib/libcxx/include/__functional/function.h:230: std::__1::__function::__default_alloc_func<ThreadFromGlobalPool::ThreadFromGlobalPool<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>(void&&)::'lambda'(), void ()>::operator()()
2022.08.18 08:54:46.025206 [ 459927 ] {} <Fatal> BaseDaemon: 18. ../contrib/libcxx/include/__functional/function.h:711: void std::__1::__function::__policy_invoker<void ()>::__call_impl<std::__1::__function::__default_alloc_func<ThreadFromGlobalPool::ThreadFromGlobalPool<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>(void&&)::'lambda'(), void ()> >(std::__1::__function::__policy_storage const*) @ 0xa442597 in /var/lib/clickhouse/clickhouse
2022.08.18 08:54:46.051554 [ 459927 ] {} <Fatal> BaseDaemon: 19.1. inlined from ./build_docker/../contrib/libcxx/include/__functional/function.h:832: std::__1::__function::__policy_func<void ()>::operator=(std::nullptr_t)
2022.08.18 08:54:46.051593 [ 459927 ] {} <Fatal> BaseDaemon: 19.2. inlined from ../contrib/libcxx/include/__functional/function.h:1157: std::__1::function<void ()>::operator=(std::nullptr_t)
2022.08.18 08:54:46.051616 [ 459927 ] {} <Fatal> BaseDaemon: 19. ../src/Common/ThreadPool.cpp:284: ThreadPoolImpl<std::__1::thread>::worker(std::__1::__list_iterator<std::__1::thread, void*>) @ 0xa43e44c in /var/lib/clickhouse/clickhouse
2022.08.18 08:54:46.079663 [ 459927 ] {} <Fatal> BaseDaemon: 20.1. inlined from ./build_docker/../contrib/libcxx/include/__memory/unique_ptr.h:312: std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >::reset(std::__1::__thread_struct*)
2022.08.18 08:54:46.079704 [ 459927 ] {} <Fatal> BaseDaemon: 20.2. inlined from ../contrib/libcxx/include/__memory/unique_ptr.h:269: ~unique_ptr
2022.08.18 08:54:46.079726 [ 459927 ] {} <Fatal> BaseDaemon: 20.3. inlined from ../contrib/libcxx/include/tuple:210: ~__tuple_leaf
2022.08.18 08:54:46.079743 [ 459927 ] {} <Fatal> BaseDaemon: 20.4. inlined from ../contrib/libcxx/include/tuple:470: ~tuple
2022.08.18 08:54:46.079789 [ 459927 ] {} <Fatal> BaseDaemon: 20.5. inlined from ../contrib/libcxx/include/__memory/unique_ptr.h:54: std::__1::default_delete<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()> >::operator()(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>*) const
2022.08.18 08:54:46.079846 [ 459927 ] {} <Fatal> BaseDaemon: 20.6. inlined from ../contrib/libcxx/include/__memory/unique_ptr.h:315: std::__1::unique_ptr<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>, std::__1::default_delete<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()> > >::reset(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>*)
2022.08.18 08:54:46.079897 [ 459927 ] {} <Fatal> BaseDaemon: 20.7. inlined from ../contrib/libcxx/include/__memory/unique_ptr.h:269: ~unique_ptr
2022.08.18 08:54:46.079942 [ 459927 ] {} <Fatal> BaseDaemon: 20. ../contrib/libcxx/include/thread:295: void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()> >(void*) @ 0xa4416dd in /var/lib/clickhouse/clickhouse
2022.08.18 08:54:46.079989 [ 459927 ] {} <Fatal> BaseDaemon: 21. ? @ 0x7f989919a609 in ?
2022.08.18 08:54:46.080034 [ 459927 ] {} <Fatal> BaseDaemon: 22. clone @ 0x7f98990bf163 in ?
2022.08.18 08:54:46.231250 [ 459927 ] {} <Fatal> BaseDaemon: Integrity check of the executable successfully passed (checksum: AFC43756B281818FB7C9D3A2CD17E62A)
```
auto extract_names_and_types = [&column](const auto & paths, const auto & types)
        {
            NamesAndTypes res;
            res.reserve(paths.size());
            for (size_t i = 0; i < paths.size(); ++i)
            {
                auto full_name = Nested::concatenateName(column.name, paths[i].getPath());
                res.emplace_back(full_name, types[i]);
            }
            ::sort(res.begin(), res.end());
            return res;
        };
        auto available_names_types = extract_names_and_types(available_paths, available_types);
        auto expected_names_types = extract_names_and_types(expected_paths, expected_types);
        std::set_difference(
            expected_names_types.begin(), expected_names_types.end(),
            available_names_types.begin(), available_names_types.end(),
            std::back_inserter(missed_names_types),
            [](const auto & lhs, const auto & rhs) { return lhs.name < rhs.name; });
    }
    if (missed_names_types.empty())
        return;
    IdentifierNameSet identifiers;
    query->collectIdentifierNames(identifiers);
    
    for (const auto & [name, type] : missed_names_types)
        if (identifiers.contains(name))
            addConstantToWithClause(query, name, type);
}
void finalizeObjectColumns(const MutableColumns & columns)