https://s3.amazonaws.com/clickhouse-test-reports/0/58f8c8726595e54092cf8f30fed729a7ed1d3fd3/stress_test__undefined__actions_.html
```
/var/log/clickhouse-server/clickhouse-server.err.log:2022.06.02 23:23:48.748947 [ 13574 ] {e0d43260-253d-4ae4-b286-46b0f883c55e} <Fatal> : Logical error: 'Block structure mismatch in  function connect between CopyingDataToViewsTransform and PushingToWindowViewSink stream: different names of columns:
/var/log/clickhouse-server/clickhouse-server.err.log:2022.06.02 23:30:17.154250 [ 50174 ] {} <Fatal> BaseDaemon: ########################################
/var/log/clickhouse-server/clickhouse-server.err.log:2022.06.02 23:30:17.155146 [ 50174 ] {} <Fatal> BaseDaemon: (version 22.6.1.1 (official build), build id: F6EB5249B406F1C9) (from thread 13574) (query_id: e0d43260-253d-4ae4-b286-46b0f883c55e) (query: insert into mt values ) Received signal Aborted (6)
/var/log/clickhouse-server/clickhouse-server.err.log:2022.06.02 23:30:17.170638 [ 50174 ] {} <Fatal> BaseDaemon: 
/var/log/clickhouse-server/clickhouse-server.err.log:2022.06.02 23:30:17.170981 [ 50174 ] {} <Fatal> BaseDaemon: Stack trace: 0x7f41f8dbd03b 0x7f41f8d9c859 0xfc35d2b 0xfc35f85 0x227cc964 0x227c5106 0x227ca323 0x24d93826 0x251b43ce 0x238c45d8 0x238c6908 0x23d69e34 0x23d6690a 0x24d24d98 0x24d41cf6 0x26be2e0c 0x26be32e5 0x26d61547 0x26d5ee2c 0x7f41f8f74609 0x7f41f8e99163
/var/log/clickhouse-server/clickhouse-server.err.log:2022.06.02 23:30:17.173551 [ 50174 ] {} <Fatal> BaseDaemon: 3. raise @ 0x7f41f8dbd03b in ?
/var/log/clickhouse-server/clickhouse-server.err.log:2022.06.02 23:30:17.173869 [ 50174 ] {} <Fatal> BaseDaemon: 4. abort @ 0x7f41f8d9c859 in ?
/var/log/clickhouse-server/clickhouse-server.err.log:2022.06.02 23:30:17.200944 [ 50174 ] {} <Fatal> BaseDaemon: 5. ./build_docker/../src/Common/Exception.cpp:47: DB::abortOnFailedAssertion(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) @ 0xfc35d2b in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.err.log:2022.06.02 23:30:17.229140 [ 50174 ] {} <Fatal> BaseDaemon: 6. ./build_docker/../src/Common/Exception.cpp:70: DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, bool) @ 0xfc35f85 in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.err.log:2022.06.02 23:30:17.264224 [ 50174 ] {} <Fatal> BaseDaemon: 7. ./build_docker/../src/Core/Block.cpp:35: void DB::onError<void>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x227cc964 in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.err.log:2022.06.02 23:30:17.328316 [ 50174 ] {} <Fatal> BaseDaemon: 8. ./build_docker/../src/Core/Block.cpp:0: void DB::checkColumnStructure<void>(DB::ColumnWithTypeAndName const&, DB::ColumnWithTypeAndName const&, std::__1::basic_string_view<char, std::__1::char_traits<char> >, bool, int) @ 0x227c5106 in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.err.log:2022.06.02 23:30:17.386634 [ 50174 ] {} <Fatal> BaseDaemon: 9. ./build_docker/../src/Core/Block.cpp:98: void DB::checkBlockStructure<void>(DB::Block const&, DB::Block const&, std::__1::basic_string_view<char, std::__1::char_traits<char> >, bool) @ 0x227ca323 in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.err.log:2022.06.02 23:30:17.495700 [ 50174 ] {} <Fatal> BaseDaemon: 10. ./build_docker/../src/Processors/Port.cpp:0: DB::connect(DB::OutputPort&, DB::InputPort&) @ 0x24d93826 in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.err.log:2022.06.02 23:30:17.538192 [ 50174 ] {} <Fatal> BaseDaemon: 11. ./build_docker/../src/Processors/Transforms/buildPushingToViewsChain.cpp:375: DB::buildPushingToViewsChain(std::__1::shared_ptr<DB::IStorage> const&, std::__1::shared_ptr<DB::StorageInMemoryMetadata const> const&, std::__1::shared_ptr<DB::Context const>, std::__1::shared_ptr<DB::IAST> const&, bool, DB::ThreadStatus*, std::__1::atomic<unsigned long>*, DB::Block const&) @ 0x251b43ce in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.err.log:2022.06.02 23:30:17.784897 [ 50174 ] {} <Fatal> BaseDaemon: 12. ./build_docker/../src/Interpreters/InterpreterInsertQuery.cpp:253: DB::InterpreterInsertQuery::buildChainImpl(std::__1::shared_ptr<DB::IStorage> const&, std::__1::shared_ptr<DB::StorageInMemoryMetadata const> const&, DB::Block const&, DB::ThreadStatus*, std::__1::atomic<unsigned long>*) @ 0x238c45d8 in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.err.log:2022.06.02 23:30:17.904851 [ 50174 ] {} <Fatal> BaseDaemon: 13. ./build_docker/../src/Interpreters/InterpreterInsertQuery.cpp:431: DB::InterpreterInsertQuery::execute() @ 0x238c6908 in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.err.log:2022.06.02 23:30:17.993259 [ 50174 ] {} <Fatal> BaseDaemon: 14. ./build_docker/../src/Interpreters/executeQuery.cpp:0: DB::executeQueryImpl(char const*, char const*, std::__1::shared_ptr<DB::Context>, bool, DB::QueryProcessingStage::Enum, DB::ReadBuffer*) @ 0x23d69e34 in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.err.log:2022.06.02 23:30:18.167544 [ 50174 ] {} <Fatal> BaseDaemon: 15. ./build_docker/../src/Interpreters/executeQuery.cpp:1069: 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) @ 0x23d6690a in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.err.log:2022.06.02 23:30:18.347373 [ 50174 ] {} <Fatal> BaseDaemon: 16. ./build_docker/../src/Server/TCPHandler.cpp:332: DB::TCPHandler::runImpl() @ 0x24d24d98 in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.err.log:2022.06.02 23:30:18.418500 [ 50174 ] {} <Fatal> BaseDaemon: 17. ./build_docker/../src/Server/TCPHandler.cpp:1775: DB::TCPHandler::run() @ 0x24d41cf6 in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.err.log:2022.06.02 23:30:18.434038 [ 50174 ] {} <Fatal> BaseDaemon: 18. ./build_docker/../contrib/poco/Net/src/TCPServerConnection.cpp:57: Poco::Net::TCPServerConnection::start() @ 0x26be2e0c in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.err.log:2022.06.02 23:30:18.453419 [ 50174 ] {} <Fatal> BaseDaemon: 19.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
/var/log/clickhouse-server/clickhouse-server.err.log:2022.06.02 23:30:18.454478 [ 50174 ] {} <Fatal> BaseDaemon: 19.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*)
/var/log/clickhouse-server/clickhouse-server.err.log:2022.06.02 23:30:18.454782 [ 50174 ] {} <Fatal> BaseDaemon: 19.3. inlined from ../contrib/libcxx/include/__memory/unique_ptr.h:269: ~unique_ptr
/var/log/clickhouse-server/clickhouse-server.err.log:2022.06.02 23:30:18.455114 [ 50174 ] {} <Fatal> BaseDaemon: 19. ../contrib/poco/Net/src/TCPServerDispatcher.cpp:116: Poco::Net::TCPServerDispatcher::run() @ 0x26be32e5 in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.err.log:2022.06.02 23:30:18.473774 [ 50174 ] {} <Fatal> BaseDaemon: 20. ./build_docker/../contrib/poco/Foundation/src/ThreadPool.cpp:213: Poco::PooledThread::run() @ 0x26d61547 in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.err.log:2022.06.02 23:30:18.485870 [ 50174 ] {} <Fatal> BaseDaemon: 21.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*)
/var/log/clickhouse-server/clickhouse-server.err.log:2022.06.02 23:30:18.487932 [ 50174 ] {} <Fatal> BaseDaemon: 21.2. inlined from ../contrib/poco/Foundation/include/Poco/SharedPtr.h:208: Poco::SharedPtr<Poco::Runnable, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::Runnable> >::operator=(Poco::Runnable*)
/var/log/clickhouse-server/clickhouse-server.err.log:2022.06.02 23:30:18.488981 [ 50174 ] {} <Fatal> BaseDaemon: 21. ../contrib/poco/Foundation/src/Thread_POSIX.cpp:360: Poco::ThreadImpl::runnableEntry(void*) @ 0x26d5ee2c in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.err.log:2022.06.02 23:30:18.489519 [ 50174 ] {} <Fatal> BaseDaemon: 22. ? @ 0x7f41f8f74609 in ?
/var/log/clickhouse-server/clickhouse-server.err.log:2022.06.02 23:30:18.489898 [ 50174 ] {} <Fatal> BaseDaemon: 23. __clone @ 0x7f41f8e99163 in ?
/var/log/clickhouse-server/clickhouse-server.err.log:2022.06.02 23:30:19.695315 [ 50174 ] {} <Fatal> BaseDaemon: Checksum of the binary: 666A22026EC8DDF6B378E56897950842, integrity check passed.
/var/log/clickhouse-server/clickhouse-server.err.log:2022.06.02 23:30:38.897334 [ 623 ] {} <Fatal> Application: Child process was terminated by signal 6.
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.06.02 23:23:48.748947 [ 13574 ] {e0d43260-253d-4ae4-b286-46b0f883c55e} <Fatal> : Logical error: 'Block structure mismatch in  function connect between CopyingDataToViewsTransform and PushingToWindowViewSink stream: different names of columns:
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.06.02 23:30:17.154250 [ 50174 ] {} <Fatal> BaseDaemon: ########################################
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.06.02 23:30:17.155146 [ 50174 ] {} <Fatal> BaseDaemon: (version 22.6.1.1 (official build), build id: F6EB5249B406F1C9) (from thread 13574) (query_id: e0d43260-253d-4ae4-b286-46b0f883c55e) (query: insert into mt values ) Received signal Aborted (6)
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.06.02 23:30:17.170638 [ 50174 ] {} <Fatal> BaseDaemon: 
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.06.02 23:30:17.170981 [ 50174 ] {} <Fatal> BaseDaemon: Stack trace: 0x7f41f8dbd03b 0x7f41f8d9c859 0xfc35d2b 0xfc35f85 0x227cc964 0x227c5106 0x227ca323 0x24d93826 0x251b43ce 0x238c45d8 0x238c6908 0x23d69e34 0x23d6690a 0x24d24d98 0x24d41cf6 0x26be2e0c 0x26be32e5 0x26d61547 0x26d5ee2c 0x7f41f8f74609 0x7f41f8e99163
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.06.02 23:30:17.173551 [ 50174 ] {} <Fatal> BaseDaemon: 3. raise @ 0x7f41f8dbd03b in ?
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.06.02 23:30:17.173869 [ 50174 ] {} <Fatal> BaseDaemon: 4. abort @ 0x7f41f8d9c859 in ?
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.06.02 23:30:17.200944 [ 50174 ] {} <Fatal> BaseDaemon: 5. ./build_docker/../src/Common/Exception.cpp:47: DB::abortOnFailedAssertion(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) @ 0xfc35d2b in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.06.02 23:30:17.229140 [ 50174 ] {} <Fatal> BaseDaemon: 6. ./build_docker/../src/Common/Exception.cpp:70: DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, bool) @ 0xfc35f85 in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.06.02 23:30:17.264224 [ 50174 ] {} <Fatal> BaseDaemon: 7. ./build_docker/../src/Core/Block.cpp:35: void DB::onError<void>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x227cc964 in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.06.02 23:30:17.328316 [ 50174 ] {} <Fatal> BaseDaemon: 8. ./build_docker/../src/Core/Block.cpp:0: void DB::checkColumnStructure<void>(DB::ColumnWithTypeAndName const&, DB::ColumnWithTypeAndName const&, std::__1::basic_string_view<char, std::__1::char_traits<char> >, bool, int) @ 0x227c5106 in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.06.02 23:30:17.386634 [ 50174 ] {} <Fatal> BaseDaemon: 9. ./build_docker/../src/Core/Block.cpp:98: void DB::checkBlockStructure<void>(DB::Block const&, DB::Block const&, std::__1::basic_string_view<char, std::__1::char_traits<char> >, bool) @ 0x227ca323 in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.06.02 23:30:17.495700 [ 50174 ] {} <Fatal> BaseDaemon: 10. ./build_docker/../src/Processors/Port.cpp:0: DB::connect(DB::OutputPort&, DB::InputPort&) @ 0x24d93826 in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.06.02 23:30:17.538192 [ 50174 ] {} <Fatal> BaseDaemon: 11. ./build_docker/../src/Processors/Transforms/buildPushingToViewsChain.cpp:375: DB::buildPushingToViewsChain(std::__1::shared_ptr<DB::IStorage> const&, std::__1::shared_ptr<DB::StorageInMemoryMetadata const> const&, std::__1::shared_ptr<DB::Context const>, std::__1::shared_ptr<DB::IAST> const&, bool, DB::ThreadStatus*, std::__1::atomic<unsigned long>*, DB::Block const&) @ 0x251b43ce in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.06.02 23:30:17.784897 [ 50174 ] {} <Fatal> BaseDaemon: 12. ./build_docker/../src/Interpreters/InterpreterInsertQuery.cpp:253: DB::InterpreterInsertQuery::buildChainImpl(std::__1::shared_ptr<DB::IStorage> const&, std::__1::shared_ptr<DB::StorageInMemoryMetadata const> const&, DB::Block const&, DB::ThreadStatus*, std::__1::atomic<unsigned long>*) @ 0x238c45d8 in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.06.02 23:30:17.904851 [ 50174 ] {} <Fatal> BaseDaemon: 13. ./build_docker/../src/Interpreters/InterpreterInsertQuery.cpp:431: DB::InterpreterInsertQuery::execute() @ 0x238c6908 in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.06.02 23:30:17.993259 [ 50174 ] {} <Fatal> BaseDaemon: 14. ./build_docker/../src/Interpreters/executeQuery.cpp:0: DB::executeQueryImpl(char const*, char const*, std::__1::shared_ptr<DB::Context>, bool, DB::QueryProcessingStage::Enum, DB::ReadBuffer*) @ 0x23d69e34 in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.06.02 23:30:18.167544 [ 50174 ] {} <Fatal> BaseDaemon: 15. ./build_docker/../src/Interpreters/executeQuery.cpp:1069: 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) @ 0x23d6690a in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.06.02 23:30:18.347373 [ 50174 ] {} <Fatal> BaseDaemon: 16. ./build_docker/../src/Server/TCPHandler.cpp:332: DB::TCPHandler::runImpl() @ 0x24d24d98 in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.06.02 23:30:18.418500 [ 50174 ] {} <Fatal> BaseDaemon: 17. ./build_docker/../src/Server/TCPHandler.cpp:1775: DB::TCPHandler::run() @ 0x24d41cf6 in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.06.02 23:30:18.434038 [ 50174 ] {} <Fatal> BaseDaemon: 18. ./build_docker/../contrib/poco/Net/src/TCPServerConnection.cpp:57: Poco::Net::TCPServerConnection::start() @ 0x26be2e0c in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.06.02 23:30:18.453419 [ 50174 ] {} <Fatal> BaseDaemon: 19.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
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.06.02 23:30:18.454478 [ 50174 ] {} <Fatal> BaseDaemon: 19.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*)
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.06.02 23:30:18.454782 [ 50174 ] {} <Fatal> BaseDaemon: 19.3. inlined from ../contrib/libcxx/include/__memory/unique_ptr.h:269: ~unique_ptr
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.06.02 23:30:18.455114 [ 50174 ] {} <Fatal> BaseDaemon: 19. ../contrib/poco/Net/src/TCPServerDispatcher.cpp:116: Poco::Net::TCPServerDispatcher::run() @ 0x26be32e5 in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.06.02 23:30:18.473774 [ 50174 ] {} <Fatal> BaseDaemon: 20. ./build_docker/../contrib/poco/Foundation/src/ThreadPool.cpp:213: Poco::PooledThread::run() @ 0x26d61547 in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.06.02 23:30:18.485870 [ 50174 ] {} <Fatal> BaseDaemon: 21.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*)
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.06.02 23:30:18.487932 [ 50174 ] {} <Fatal> BaseDaemon: 21.2. inlined from ../contrib/poco/Foundation/include/Poco/SharedPtr.h:208: Poco::SharedPtr<Poco::Runnable, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::Runnable> >::operator=(Poco::Runnable*)
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.06.02 23:30:18.488981 [ 50174 ] {} <Fatal> BaseDaemon: 21. ../contrib/poco/Foundation/src/Thread_POSIX.cpp:360: Poco::ThreadImpl::runnableEntry(void*) @ 0x26d5ee2c in /usr/bin/clickhouse
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.06.02 23:30:18.489519 [ 50174 ] {} <Fatal> BaseDaemon: 22. ? @ 0x7f41f8f74609 in ?
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.06.02 23:30:18.489898 [ 50174 ] {} <Fatal> BaseDaemon: 23. __clone @ 0x7f41f8e99163 in ?
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.06.02 23:30:19.695315 [ 50174 ] {} <Fatal> BaseDaemon: Checksum of the binary: 666A22026EC8DDF6B378E56897950842, integrity check passed.
/var/log/clickhouse-server/clickhouse-server.stress.log:2022.06.02 23:30:38.897334 [ 623 ] {} <Fatal> Application: Child process was terminated by signal 6.
```

cc: @Vxider, @kssenii 
, clean_interval_usec(context_->getSettingsRef().window_view_clean_interval.totalMicroseconds())
{
    if (!query.select)
        throw Exception(ErrorCodes::INCORRECT_QUERY, "SELECT query is not specified for {}", getName());
    StorageInMemoryMetadata storage_metadata;
    storage_metadata.setColumns(columns_);
    setInMemoryMetadata(storage_metadata);
    if (!query.select)
        throw Exception(ErrorCodes::INCORRECT_QUERY, "SELECT query is not specified for {}", getName());
    
    has_inner_target_table = query.to_table_id.empty();
    if (has_inner_target_table && !query.storage)
        throw Exception(
            "You must specify where to save results of a WindowView query: either ENGINE or an existing table in a TO clause",
            ErrorCodes::INCORRECT_QUERY);
    if (query.select->list_of_selects->children.size() != 1)
        throw Exception(
            ErrorCodes::QUERY_IS_NOT_SUPPORTED_IN_WINDOW_VIEW,
            "UNION is not supported for {}", getName());
    
    eventTimeParser(query);
    auto inner_query = initInnerQuery(query.select->list_of_selects->children.at(0)->as<ASTSelectQuery &>(), context_);
    if (query.inner_storage)
        inner_table_engine = query.inner_storage->clone();
    inner_table_id = StorageID(getStorageID().database_name, generateInnerTableName(getStorageID()));
    inner_fetch_query = generateInnerFetchQuery(inner_table_id);
    target_table_id = has_inner_target_table ? StorageID(table_id_.database_name, generateTargetTableName(table_id_)) : query.to_table_id;
    if (is_proctime)
        next_fire_signal = getWindowUpperBound(std::time(nullptr));
    std::exchange(has_inner_table, true);