ClickHouse/tests/queries/0_stateless/00729_prewhere_array_join.sql

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
2.6 KiB
MySQL
Raw Normal View History

2020-06-20 11:29:01 +00:00
SET send_logs_level = 'fatal';
2018-10-11 20:52:25 +00:00
2019-06-03 17:36:27 +00:00
drop table if exists t1_00729;
2022-06-23 08:37:52 +00:00
set allow_deprecated_syntax_for_merge_tree=1;
2019-06-03 17:36:27 +00:00
create table t1_00729 (id UInt64, val Array(String),nid UInt64, eDate Date)ENGINE = MergeTree(eDate, (id, eDate), 8192);
2018-10-11 20:52:25 +00:00
2019-06-03 17:36:27 +00:00
insert into t1_00729 (id,val,nid,eDate) values (1,['background','foreground','heading','image'],1,'2018-09-27');
insert into t1_00729 (id,val,nid,eDate) values (1,['background','foreground','heading','image'],1,'2018-09-27');
insert into t1_00729 (id,val,nid,eDate) values (2,['background','foreground','heading','image'],1,'2018-09-27');
insert into t1_00729 (id,val,nid,eDate) values (2,[],2,'2018-09-27');
insert into t1_00729 (id,val,nid,eDate) values (3,[],4,'2018-09-27');
insert into t1_00729 (id,val,nid,eDate) values (3,[],5,'2018-09-27');
insert into t1_00729 (id,val,nid,eDate) values (3,[],6,'2018-09-27');
insert into t1_00729 (id,val,nid,eDate) values (3,[],7,'2018-09-27');
insert into t1_00729 (id,val,nid,eDate) values (3,[],8,'2018-09-27');
2018-10-11 20:52:25 +00:00
select arrayJoin(val) as nameGroup6 from t1_00729 prewhere notEmpty(toString(nameGroup6)) group by nameGroup6 order by nameGroup6; -- { serverError ILLEGAL_PREWHERE }
2019-06-03 17:36:27 +00:00
select arrayJoin(val) as nameGroup6, countDistinct(nid) as rowids from t1_00729 where notEmpty(toString(nameGroup6)) group by nameGroup6 order by nameGroup6;
select arrayJoin(val) as nameGroup6, countDistinct(nid) as rowids from t1_00729 prewhere notEmpty(toString(nameGroup6)) group by nameGroup6 order by nameGroup6; -- { serverError ILLEGAL_PREWHERE }
2018-10-11 20:52:25 +00:00
2019-06-03 17:36:27 +00:00
drop table t1_00729;
create table t1_00729 (id UInt64, val Array(String),nid UInt64, eDate Date) ENGINE = MergeTree(eDate, (id, eDate), 8192);
2018-10-11 20:52:25 +00:00
2019-06-03 17:36:27 +00:00
insert into t1_00729 (id,val,nid,eDate) values (1,['background','foreground','heading','image'],1,'2018-09-27');
insert into t1_00729 (id,val,nid,eDate) values (1,['background','foreground','heading','image'],1,'2018-09-27');
insert into t1_00729 (id,val,nid,eDate) values (2,['background','foreground','heading','image'],1,'2018-09-27');
insert into t1_00729 (id,val,nid,eDate) values (2,[],2,'2018-09-27');
2018-10-11 20:52:25 +00:00
select arrayJoin(val) as nameGroup6 from t1_00729 prewhere notEmpty(toString(nameGroup6)) group by nameGroup6 order by nameGroup6; -- { serverError ILLEGAL_PREWHERE }
2019-06-03 17:36:27 +00:00
select arrayJoin(val) as nameGroup6, countDistinct(nid) as rowids from t1_00729 where notEmpty(toString(nameGroup6)) group by nameGroup6 order by nameGroup6;
select arrayJoin(val) as nameGroup6, countDistinct(nid) as rowids from t1_00729 prewhere notEmpty(toString(nameGroup6)) group by nameGroup6 order by nameGroup6; -- { serverError ILLEGAL_PREWHERE }
2018-10-11 20:52:25 +00:00
2019-06-03 17:36:27 +00:00
drop table t1_00729;