frankegoesdown
frankegoesdown

Reputation: 1924

Duplicated rows in response with engine - Merge

I have 3 tables events_0, events_1, events_2 with Engine = MergeTree

and 1 table events with Engine = Merge

CREATE TABLE events as events_0 ENGINE=Merge(currentDatabase(), '^events');

When I run sql query like

select uuid from events where uuid = 'XXXX-YYY-ZZZZ';

I've got a duplicated response

┌─uuid──────────┐
│ XXXX-YYY-ZZZZ │
└───────────────┘
┌─uuid──────────┐
│ XXXX-YYY-ZZZZ │
└───────────────┘

Upvotes: 0

Views: 72

Answers (1)

Amos
Amos

Reputation: 3276

Try adding _table to the select clause to see which table was generating the data.

select _table, uuid from events where uuid = 'XXXX-YYY-ZZZZ';

It looks like a self-recursion to me. You might need to rename the merge table that won't be matched by regex ^events

Upvotes: 2

Related Questions