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

DESCRIBE return wrong result for sumMap/minMap/maxMap #34233

Closed
alrocar opened this issue Feb 1, 2022 · 2 comments
Closed

DESCRIBE return wrong result for sumMap/minMap/maxMap #34233

alrocar opened this issue Feb 1, 2022 · 2 comments
Labels
question Question?

Comments

@alrocar
Copy link

alrocar commented Feb 1, 2022

I'd expect a DESCRIBE on a sumMap agg function to return

AggregateFunction(sumMap, Tuple(Array(UInt32), Array(UInt32)))

but in recent versions is returning:

AggregateFunction(1, sumMap, Tuple(Array(UInt32), Array(UInt32)))

See example:

SELECT version()

Query id: 72a9cc69-7bd0-4b64-b7ce-e3634e238291

┌─version()─┐
│ 21.11.1.1 │
└───────────┘

1 rows in set. Elapsed: 0.002 sec.

localhost :)  describe (select sumMapState(([rand()], [rand()])));

DESCRIBE TABLE
(
    SELECT sumMapState(([rand()], [rand()]))
)

Query id: 2b9fc06f-640a-42b0-a6a9-4f133230109a

┌─name─────────────────────────────────────────────┬─type───────────────────────────────────────────────────────────┬─default_type─┬─default_expression─┬─comment─┬─codec_expression─┬─ttl_expression─┐
│ sumMapState(tuple(array(rand()), array(rand()))) │ AggregateFunction(sumMap, Tuple(Array(UInt32), Array(UInt32))) │              │                    │         │                  │                │
└──────────────────────────────────────────────────┴────────────────────────────────────────────────────────────────┴──────────────┴────────────────────┴─────────┴──────────────────┴────────────────┘

1 rows in set. Elapsed: 0.002 sec.
SELECT version()

Query id: 66449025-c544-47ae-9c17-655813820200

┌─version()──┐
│ 21.12.3.32 │
└────────────┘

1 rows in set. Elapsed: 0.003 sec.

runner--project-0-concurrent-0 :) describe (select sumMapState(([rand()], [rand()])))

DESCRIBE TABLE
(
    SELECT sumMapState(([rand()], [rand()]))
)

Query id: bc1bf0fe-8412-463d-93fd-1804f0413d5d

┌─name─────────────────────────────────────────────┬─type──────────────────────────────────────────────────────────────┬─default_type─┬─default_expression─┬─comment─┬─codec_expression─┬─ttl_expression─┐
│ sumMapState(tuple(array(rand()), array(rand()))) │ AggregateFunction(1, sumMap, Tuple(Array(UInt32), Array(UInt32))) │              │                    │         │                  │                │
└──────────────────────────────────────────────────┴───────────────────────────────────────────────────────────────────┴──────────────┴────────────────────┴─────────┴──────────────────┴────────────────┘

1 rows in set. Elapsed: 0.003 sec.
@alrocar alrocar added the potential bug To be reviewed by developers and confirmed/rejected. label Feb 1, 2022
@alexey-milovidov
Copy link
Member

This is absolutely correct and indicates that the first version of the sumMap aggregate function is using.
See #12552.

@alexey-milovidov alexey-milovidov added question Question? and removed potential bug To be reviewed by developers and confirmed/rejected. labels Feb 3, 2022
@alrocar
Copy link
Author

alrocar commented Feb 3, 2022

I see, thanks!

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

No branches or pull requests

2 participants