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

[Bug] With in in select smt and group by will cause missing from GROUP BY #10881

Closed
2 of 3 tasks
kkfnui opened this issue Jul 15, 2022 · 1 comment · Fixed by #11033
Closed
2 of 3 tasks

[Bug] With in in select smt and group by will cause missing from GROUP BY #10881

kkfnui opened this issue Jul 15, 2022 · 1 comment · Fixed by #11033

Comments

@kkfnui
Copy link
Contributor

kkfnui commented Jul 15, 2022

Search before asking

  • I had searched in the issues and found no similar issues.

Version

1.1.0

What's Wrong?

select list expression not produced by aggregation output (missing from GROUP BY clause?): sum(if(stat_type IN (1), 1, 0))

What You Expected?

No error

How to Reproduce?

create a test table

CREATE TABLE `test_doris_11_log` (
    `date` date NOT NULL COMMENT "",
    `uid` varchar(64) NOT NULL,
    `stat_type` int(11) NOT NULL COMMENT "",

    `price` varchar(255) NULL COMMENT "price"
)
DUPLICATE KEY(`date`, `uid`, `stat_type`)
COMMENT "OLAP"
PARTITION BY RANGE(`date`)()
DISTRIBUTED BY HASH(`uid`) BUCKETS 8
PROPERTIES (
"replication_allocation" = "tag.location.default: 3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.end" = "2",
"dynamic_partition.prefix" = "p",
"dynamic_partition.replication_allocation" = "tag.location.default: 3",
"dynamic_partition.buckets" = "8",
"dynamic_partition.create_history_partition" = "true",
"dynamic_partition.history_partition_num" = "2",
"dynamic_partition.hot_partition_num" = "2",
"storage_format" = "V2"
);

insert test data

insert into test_doris_11_log values ('2022-07-15', '2222', 1, NULL), ('2022-07-15', 'ddddd', 2, '0.5');

Try some times to reproduce error

select date, sum(if(stat_type in (1), 1, 0)) from  test_doris_11_log group by date ;

Anything Else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@Kikyou1997
Copy link
Contributor

I can't reproduce this bug on my local machine....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants