Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

18.5.1 Wrong MV evaluation with SELECT DISTINCT (started in 18.1 and upto 18.6.0) #2795

Closed
den-crane opened this issue Aug 2, 2018 · 2 comments
Assignees
Labels
bug Confirmed user-visible misbehaviour in official release

Comments

@den-crane
Copy link
Contributor

ClickHouse client version 18.5.1.
Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 18.5.54400.

CREATE TABLE test ( x String) ENGINE = Null;

create MATERIALIZED VIEW test_mv_bad (x String)
ENGINE = MergeTree Partition by tuple() order by tuple()
AS SELECT DISTINCT x FROM test;

create MATERIALIZED VIEW test_mv_good (x String)
ENGINE = MergeTree Partition by tuple() order by tuple()
AS SELECT x FROM test;

insert into test values('stest');

select * from test_mv_bad
Ok.
0 rows in set. Elapsed: 0.007 sec.

select * from test_mv_good
┌─x─────┐
│ stest │
└───────┘
1 rows in set. Elapsed: 0.001 sec.

@SaltTan
Copy link
Contributor

SaltTan commented Aug 2, 2018

This one works:

drop table if exists test_mv_group;
create MATERIALIZED VIEW test_mv_group (x String)
ENGINE = MergeTree Partition by tuple() order by tuple()
AS SELECT x FROM test.test group by x;

select * from test_mv_group
┌─x─────┐
│ stest │
└───────┘
1 rows in set. Elapsed: 0.001 sec.

@den-crane den-crane changed the title 18.5.1 Wrong MV evaluation with SELECT DISTINCT (seems the same in 18.1) 18.5.1 Wrong MV evaluation with SELECT DISTINCT (started in 18.1 and upto 18.6.0) Aug 3, 2018
alexey-milovidov added a commit that referenced this issue Aug 8, 2018
@alexey-milovidov alexey-milovidov self-assigned this Aug 8, 2018
@alexey-milovidov alexey-milovidov added the bug Confirmed user-visible misbehaviour in official release label Aug 8, 2018
alexey-milovidov added a commit that referenced this issue Aug 8, 2018
@alexey-milovidov
Copy link
Member

Fixed in master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed user-visible misbehaviour in official release
Projects
None yet
Development

No branches or pull requests

3 participants