CREATE TABLE test ENGINE=ReplacingMergeTree ORDER BY n AS SELECT intDiv(number,2) as n from numbers(10000000);
SET prefer_localhost_replica=0, max_bytes_to_read=1000000;
-- SET allow_experimental_analyzer=0;
SELECT '1st query';
SELECT * FROM cluster('default', currentDatabase(), test) FINAL WHERE n=100;
CREATE VIEW test_view AS SELECT * FROM cluster('default', currentDatabase(), test) FINAL;
SELECT '2nd query';
SELECT * from test_view WHERE n=100; --fails with analizer enabled
Fiddle: https://fiddle.clickhouse.com/5e00a72a-9989-4d57-93df-b5645b980b75