doris icon indicating copy to clipboard operation
doris copied to clipboard

[Bug] count (distinct (xxx)) over is not support

Open siriume opened this issue 3 years ago • 3 comments

Search before asking

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

Version

dev-1.1.2-236f394

What's Wrong?

sql like this:

CREATE TABLE `test`
(
    `id`    bigint       NOT NULL,
    `date`  date REPLACE_IF_NOT_NULL NOT NULL
) ENGINE = OLAP AGGREGATE KEY(`id` )
DISTRIBUTED BY HASH(`id`) BUCKETS 3
PROPERTIES (
"replication_num" = "3",
"compression"="zstd"
);

SELECT count(distinct (date)) over (partition by id) count_days FROM test;

ERROR:

[HY000][1105] errCode = 2, detailMessage = DISTINCT not allowed in analytic function: count(DISTINCT (`date`))

What You Expected?

sql execute succeed.

How to Reproduce?

No response

Anything Else?

No response

Are you willing to submit PR?

  • [ ] Yes I am willing to submit a PR!

Code of Conduct

siriume avatar Aug 11 '22 06:08 siriume

sorry, Doris do not support use distinct aggregate function as analytic function now.

morrySnow avatar Aug 11 '22 08:08 morrySnow

sorry, Doris do not support use distinct aggregate function as analytic function now.

documents says its support https://doris.apache.org/docs/sql-manual/sql-functions/window-functions/WINDOW-FUNCTION-COUNT/

siriume avatar Aug 11 '22 08:08 siriume

i think document has a mistake on it. i has review the code. it is not support yet.

morrySnow avatar Aug 11 '22 09:08 morrySnow

Thank you for your question,I find this is an error in the document. and I will modify the document.

LemonLiTree avatar Aug 13 '22 06:08 LemonLiTree