ClickHouse/tests/queries/0_stateless/02008_aliased_column_distributed_bug.sql
2021-09-12 17:15:28 +03:00

19 lines
758 B
SQL
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- Tags: distributed
DROP TABLE IF EXISTS click_storage;
DROP TABLE IF EXISTS click_storage_dst;
CREATE TABLE click_storage ( `PhraseID` UInt64, `PhraseProcessedID` UInt64 ALIAS if(PhraseID > 5, PhraseID, 0) ) ENGINE = MergeTree() ORDER BY tuple();
INSERT INTO click_storage SELECT number AS PhraseID from numbers(10);
CREATE TABLE click_storage_dst ( `PhraseID` UInt64, `PhraseProcessedID` UInt64 ) ENGINE = Distributed(test_shard_localhost, currentDatabase(), 'click_storage');
SET prefer_localhost_replica = 1;
SELECT materialize(PhraseProcessedID) FROM click_storage_dst;
SET prefer_localhost_replica = 0;
SELECT materialize(PhraseProcessedID) FROM click_storage_dst;
DROP TABLE IF EXISTS click_storage;
DROP TABLE IF EXISTS click_storage_dst;