You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
alter table + prewhere: Not found column ... in block #2827
ClickHouse client version 18.6.0.
Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 18.6.0 revision 54401.
create table y(a Int64, b Int64, z Date) engine = MergeTree partition by (a,z) order by tuple();
insert into y select 1,number, toDate('2018-01-01') from numbers(1);
insert into y select 2,number, toDate('2018-02-01') from numbers(1);
alter table y add column c Array(Float32);
alter table y add column d Array(Float32);
select c,d from y prewhere a <1000;
Received exception from server (version 18.6.0):
Code: 10. DB::Exception: Received from localhost:9000, ::1. DB::Exception: Not found column c in block. There are only columns: a.
drop table if exists t;
create table t
(
a Int32,
b Int32
) engine = MergeTree partition by (a,b) order by (a);
insert into t values (1, 1);
alter table t add column c Int32;
select b from t prewhere a < 1000; -- OK
select c from t where a < 1000; -- OK
select c from t prewhere a < 1000;
-- Block structure mismatch in MergeTreeThread stream: different number of columns:
-- a Int32 Int32(size = 1)
-- a Int32 Int32(size = 0), c Int32 Int32(size = 0).
drop table if exists test.t;
create table test.t
(
a Int32,
b Int32
) engine = MergeTree partition by (a,b) order by (a);
insert into test.t values (1, 1);
alter table test.t add column c Int32;
select b from test.t prewhere a < 1000;
select c from test.t where a < 1000;
select c from test.t prewhere a < 1000;
drop table test.t;
drop table if exists test.trepl;
create table test.trepl
(
d Date,
a Int32,
b Int32
) engine = ReplacingMergeTree(d, (a,b), 8192);
insert into test.trepl values ('2018-09-19', 1, 1);
select b from test.trepl FINAL prewhere a < 1000;
drop table test.trepl;
Received exception from server (version 18.12.17):
Code: 10. DB::Exception: Received from localhost:9002, 127.0.0.1. DB::Exception: Not found column a in block. There are only columns: b.
The same for CollapsingMergeTree, and only with FINAL.
2018.09.19 15:15:56.804624 [ 54 ] {f446cb2b-b4af-4fad-a082-5b2bac65e6cf} executeQuery: Code: 10, e.displayText() = DB::Exception: Not found column a in block. There are only columns: b, sign, e.what() = DB::Exception (from 127.0.0.1:52210) (in query: select b from test.trepl FINAL prewhere a < 1000), Stack trace:
Activity
den-crane commentedon Aug 8, 2018
Though
[-]DB::Exception: Not found column ... in block[/-][+]alter table + prewhere: Not found column ... in block[/+]4ertus2 commentedon Aug 17, 2018
18.10.3
drop table if exists t;
create table t
(
a Int32,
b Int32
) engine = MergeTree partition by (a,b) order by (a);
insert into t values (1, 1);
alter table t add column c Int32;
select b from t prewhere a < 1000; -- OK
select c from t where a < 1000; -- OK
select c from t prewhere a < 1000;
-- Block structure mismatch in MergeTreeThread stream: different number of columns:
-- a Int32 Int32(size = 1)
-- a Int32 Int32(size = 0), c Int32 Int32(size = 0).
alexey-milovidov commentedon Aug 20, 2018
It is started to work in master.
This is related to changes in #2226
alexey-milovidov commentedon Aug 20, 2018
Not quite.
The last query returns empty set while it should return the same result as the previous query.
alexey-milovidov commentedon Aug 20, 2018
Ready test case:
wake-up-neo commentedon Sep 19, 2018
@alexey-milovidov Please take a look
wake-up-neo commentedon Sep 19, 2018
The same for CollapsingMergeTree, and only with FINAL.
Fix readnig missing column with prewhere. #2827
Fix prewhere whith final. #2827
Merge pull request ClickHouse#2827 from Altinity/bugfix/antalya-26.8/…