Skip to content

DB::Exception: Block structure mismatch in QueryPipeline stream: different columns (Const) #11181

@tobia

Description

@tobia

This simple view:

CREATE VIEW test.bug_const AS
SELECT 'World' AS hello
FROM (SELECT number FROM system.numbers LIMIT 1) AS n1
JOIN (SELECT number FROM system.numbers LIMIT 1) AS n2 USING (number)

is created ok, but at SELECT time throws the following exception:

Received exception from server (version 20.4.3):
Code: 171. DB::Exception: Received from localhost:9000. DB::Exception: Block structure mismatch in QueryPipeline stream: different columns:
hello String String(size = 0)
hello String Const(size = 0, String(size = 1)).

If I execute the SELECT part as as standalone query, it works, but in a VIEW it does not.

On complex views, joining other views many levels deep, this bug appears on all 20.3 and 20.4 versions of Clickhouse I tried, including 20.3.10.75, 20.4.2.9 and 20.4.3.16. But the simple way to reproduce it that I posted above only triggers the bug on 20.4 versions.

Branch 20.1 and previous ones seem to be OK.

Metadata

Metadata

Labels

bugConfirmed user-visible misbehaviour in official release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions