Clickhouse: "Cannot find column xxx in source stream" with cluster and ReplacingMergeTree

Created on 20 May 2019  Β·  5Comments  Β·  Source: ClickHouse/ClickHouse

I get an error "Cannot find column updated in source stream" in a cluster of 2 nodes with a ReplacingMergeTree(updated) if I don't select the updated column or one of the columns of the primary key.

(tested with 19.6.2.11)

How to reproduce:

  • create a 2 node cluster
  • on each node:
CREATE TABLE default.test (`Id` String, `Timestamp` DateTime, `updated` DateTime) ENGINE = ReplacingMergeTree(updated) PARTITION BY tuple() ORDER BY (Timestamp, Id)

INSERT INTO default.test VALUES('1',now(),now());

  • try to execute this query on each node:
SELECT Id,Timestamp FROM cluster('cluster','default','test') FINAL ORDER BY Timestamp

This works on one of the node and fails on the other with this error:

Code: 8. DB::Exception: Received from localhost:9000, 127.0.0.1. DB::Exception: Cannot find column updated in source stream.

Same error with this request:

select Timestamp,updated from cluster('cluster','default','test') final order by Timestamp

Code: 8. DB::Exception: Received from localhost:9000, 127.0.0.1. DB::Exception: Cannot find column Id in source stream.

Workaround: select updated and all columns of the primary key.

bug

All 5 comments

I can confirm that similar behavior is also seen on ReplicatedCollapsingMergeTree TableEngine even in CH version 19.4.3 .

I have seen this error on ReplicatedReplacingMergeTree right after an upgrade from yandex/clickhouse-server:19.13.3.26 to yandex/clickhouse-server:19.15.3.6
(as described in #7348 ).
So apparently consumption goes on, since consumer groups advance, but data does not get inserted.

Reproduced on CH version: 19.17.6

Same here for 19.17.6. Upgrading to 20.3.7 revision 54433 solved the issue.

It seems fixed.

CREATE TABLE test5346 (`Id` String, `Timestamp` DateTime, `updated` DateTime) 
ENGINE = ReplacingMergeTree(updated) PARTITION BY tuple() ORDER BY (Timestamp, Id);

INSERT INTO test5346 VALUES('1',toDateTime('2020-01-01 00:00:00'),toDateTime('2020-01-01 00:00:00'));

SELECT Id, Timestamp 
FROM remote('localhost,127.0.0.1,127.0.0.2',currentDatabase(),'test5346') FINAL 
ORDER BY Timestamp;

19.13.7.57
Received exception from server (version 19.13.7):
Code: 8. DB::Exception: Received from localhost:9000. DB::Exception: Cannot find column `updated` in source stream.

20.11.1.4897
β”Œβ”€Id─┬───────────Timestamp─┐
β”‚ 1  β”‚ 2020-01-01 00:00:00 β”‚
β””β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”Œβ”€Id─┬───────────Timestamp─┐
β”‚ 1  β”‚ 2020-01-01 00:00:00 β”‚
β””β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”Œβ”€Id─┬───────────Timestamp─┐
β”‚ 1  β”‚ 2020-01-01 00:00:00 β”‚
β””β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

I'll add a test.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jangorecki picture jangorecki  Β·  3Comments

bseng picture bseng  Β·  3Comments

healiseu picture healiseu  Β·  3Comments

innerr picture innerr  Β·  3Comments

igor-sh8 picture igor-sh8  Β·  3Comments