create table if not exists test_dist AS test engine = Distributed('default', 'default', 'test', rand());
INSERT INTO test
VALUES ('host');
INSERT INTO test
VALUES ('www');
INSERT INTO test
VALUES ('domain');
SELECT t.host_other,
anyLast(t.host_category) host_category_agg_anyLast,
uniq(t.host_category) host_category_agg_uniq
FROM test_dist t
GROUP BY t.host_other;
`
Hi
Table has 2 aliases, one depends on other.
It worked good for versions before 24.3 for all tables: distributed and not distributed.
For versions >= 24.3 it is broken for distributed (only) tables. For simple tables it works.
Works for 24.2.2.71 and earlier https://fiddle.clickhouse.com/89f370e7-4598-4a9c-8b01-3de68e2188cc
Broken for Latest https://fiddle.clickhouse.com/ca7a3d45-6472-483d-ba0d-681b8d2e4074
Works for latest if simple table (not distributed) https://fiddle.clickhouse.com/f513fd16-ed40-456d-b2cb-346535fdd8f1
` CREATE TABLE test ( host String, host_other String alias empty(host) ? 'Unknown' : replaceOne(host, '*', 'www'), host_category UInt64 alias toUInt64(host_other = 'www' ? 1 : 0) ) ENGINE = Memory;
create table if not exists test_dist AS test engine = Distributed('default', 'default', 'test', rand());
INSERT INTO test VALUES ('host'); INSERT INTO test VALUES ('www'); INSERT INTO test VALUES ('domain');
SELECT t.host_other, anyLast(t.host_category)
host_category_agg_anyLast
, uniq(t.host_category)host_category_agg_uniq
FROM test_dist t GROUP BY t.host_other; `