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

Incorrect result in JDBC connectors when aggregation result is pruned away #12598

Closed
Yao-MR-zz opened this issue May 31, 2022 · 2 comments · Fixed by #12603
Closed

Incorrect result in JDBC connectors when aggregation result is pruned away #12598

Yao-MR-zz opened this issue May 31, 2022 · 2 comments · Fixed by #12603
Labels
bug Something isn't working correctness

Comments

@Yao-MR-zz
Copy link
Member

the result of the sql is wrong,

JDBC Connector do not applyAggregation correctly for the case when the aggregates is empty and groupingSets is empty

source 1:
sql: select count(*) from mysql.test.userdata
image

source 2:
sql: select count(*) from mysql.test.userdata1
image

source 3:
sql: select count(*) from mysql.test.userdata2

image

Union sql:
select count() from (
-> select count(
) from mysql.test.userdata union all
-> select count() from mysql.test.userdata1 union all
-> select count(
) from mysql.test.userdata2
-> ) t;

image

absolute the result of Union sql is wrong,the right result should be 3

@findepi findepi added bug Something isn't working correctness labels May 31, 2022
@findepi findepi changed the title the result of the sql is wrong Incorrect result of aggregation-over-aggregation in MySQL connector May 31, 2022
@findepi
Copy link
Member

findepi commented May 31, 2022

Thanks for a very good bug report @Yao-MR .

@findepi findepi changed the title Incorrect result of aggregation-over-aggregation in MySQL connector Incorrect result in JDBC connectors when aggregation result in pruned away May 31, 2022
@findepi
Copy link
Member

findepi commented May 31, 2022

An even simpler repro case

SELECT 42 FROM (SELECT count(*) FROM nation)

@losipiuk losipiuk changed the title Incorrect result in JDBC connectors when aggregation result in pruned away Incorrect result in JDBC connectors when aggregation result is pruned away May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctness
Development

Successfully merging a pull request may close this issue.

2 participants