Clickhouse return not all rows in result

29 views
Skip to first unread message

Евгений Билык

unread,
May 18, 2021, 10:45:36 AMMay 18
to ClickHouse
Hi everyone!
I have 2 tables:
create table db.buffer_statistics_table
(
productId Int32,
created DateTime default now()
)
engine = Buffer('db', 'statistics_table', 16, 10, 300, 10000, 5000000, 10000000, 100000000);


-------

create table db.statistics_table
(
productId Int32,
created DateTime default now()
)
engine = ReplicatedMergeTree('/clickhouse/tables/1/db/statistics_table', '{replica}')
PARTITION BY toYYYYMMDD(created)
ORDER BY (productId, created)
SETTINGS index_granularity = 8192;

---------

in first table i insert data, and read data from second table:

select map.productId
from db.statistics_table map any
inner join (
select productId, max(created) as maxCreated
from db.statistics_table prewhere productId in (1000 productIds)
group by productId) pp on map.productId = pp.productId and map.created = pp.maxCreated
where map.productId in (1000 productIds)
order by map.productId desc;

Clickhouse sometimes return not all rows, it can be 800 or 300.

Can anybody help, why clickhouse have such behavour?
Reply all
Reply to author
Forward
0 new messages