You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "NobiGo (via GitHub)" <gi...@apache.org> on 2025/07/18 02:38:14 UTC
[PR] [CALCITE-1583] Wrong results for query with correlated subqueries wit… [calcite]
NobiGo opened a new pull request, #4470:
URL: https://github.com/apache/calcite/pull/4470
…h aggregate subquery expression
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-1583] Wrong results for query with correlated subqueries wit… [calcite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #4470:
URL: https://github.com/apache/calcite/pull/4470#issuecomment-3086546903
## [](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4470) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4470&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4470&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=4470&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4470&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4470&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4470)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-1583] Wrong results for query with correlated subqueries wit… [calcite]
Posted by "NobiGo (via GitHub)" <gi...@apache.org>.
NobiGo merged PR #4470:
URL: https://github.com/apache/calcite/pull/4470
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-1583] Wrong results for query with correlated subqueries wit… [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on code in PR #4470:
URL: https://github.com/apache/calcite/pull/4470#discussion_r2218051228
##########
core/src/test/resources/sql/sub-query.iq:
##########
@@ -5151,4 +5151,100 @@ EnumerableCalc(expr#0..2=[{inputs}], expr#3=[IS FALSE($t1)], expr#4=[null:BOOLEA
EnumerableValues(tuples=[[{ null }, { null }]])
!plan
+# [CALCITE-1583] Wrong results for query with correlated subqueries with aggregate subquery expression
+# Correlated sub-query with aggregate expression can optimized by Metadata RowCount
+select * from emp where exists (select count(deptno) from dept where dept.deptno = emp.deptno);
++-------+--------+--------+
Review Comment:
could you add these as comments?
is the optimization relevant for the issue being resolved?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-1583] Wrong results for query with correlated subqueries wit… [calcite]
Posted by "NobiGo (via GitHub)" <gi...@apache.org>.
NobiGo commented on code in PR #4470:
URL: https://github.com/apache/calcite/pull/4470#discussion_r2218049484
##########
core/src/test/resources/sql/sub-query.iq:
##########
@@ -5151,4 +5151,100 @@ EnumerableCalc(expr#0..2=[{inputs}], expr#3=[IS FALSE($t1)], expr#4=[null:BOOLEA
EnumerableValues(tuples=[[{ null }, { null }]])
!plan
+# [CALCITE-1583] Wrong results for query with correlated subqueries with aggregate subquery expression
+# Correlated sub-query with aggregate expression can optimized by Metadata RowCount
+select * from emp where exists (select count(deptno) from dept where dept.deptno = emp.deptno);
++-------+--------+--------+
Review Comment:
It has been verified in PostgreSQL. This plan can prove that this SQL has been optimized by the Metadata RowCount method.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-1583] Wrong results for query with correlated subqueries wit… [calcite]
Posted by "NobiGo (via GitHub)" <gi...@apache.org>.
NobiGo commented on code in PR #4470:
URL: https://github.com/apache/calcite/pull/4470#discussion_r2218061458
##########
core/src/test/resources/sql/sub-query.iq:
##########
@@ -5151,4 +5151,100 @@ EnumerableCalc(expr#0..2=[{inputs}], expr#3=[IS FALSE($t1)], expr#4=[null:BOOLEA
EnumerableValues(tuples=[[{ null }, { null }]])
!plan
+# [CALCITE-1583] Wrong results for query with correlated subqueries with aggregate subquery expression
+# Correlated sub-query with aggregate expression can optimized by Metadata RowCount
+select * from emp where exists (select count(deptno) from dept where dept.deptno = emp.deptno);
++-------+--------+--------+
Review Comment:
Since the discussion in Jira involves this SQL, I have included it in the test cases. The comments have already been added.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-1583] Wrong results for query with correlated subqueries wit… [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on code in PR #4470:
URL: https://github.com/apache/calcite/pull/4470#discussion_r2216532126
##########
core/src/test/resources/sql/sub-query.iq:
##########
@@ -5151,4 +5151,100 @@ EnumerableCalc(expr#0..2=[{inputs}], expr#3=[IS FALSE($t1)], expr#4=[null:BOOLEA
EnumerableValues(tuples=[[{ null }, { null }]])
!plan
+# [CALCITE-1583] Wrong results for query with correlated subqueries with aggregate subquery expression
+# Correlated sub-query with aggregate expression can optimized by Metadata RowCount
+select * from emp where exists (select count(deptno) from dept where dept.deptno = emp.deptno);
++-------+--------+--------+
Review Comment:
If these have been validated using another database, please add a comment.
Is there value in having the plan here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org