You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "etiennepelissier (via GitHub)" <gi...@apache.org> on 2026/08/03 14:13:21 UTC

[PR] [CALCITE-7687] RelMdSelectivity and RelMdDistinctRowCount for Aggregate can propagate a predicate with wrong references [calcite]

etiennepelissier opened a new pull request, #5145:
URL: https://github.com/apache/calcite/pull/5145

   ## Jira Link
   
   [CALCITE-7687](https://issues.apache.org/jira/browse/CALCITE-7687)
   
   ## Changes Proposed
   
   Same defect as CALCITE-4414, in the `Aggregate` overloads. An `Aggregate`'s output field `i` is input
   field `groupSet.nth(i)`, so a predicate expressed over the aggregate's output must be converted
   before it is pushed to the input.
   
   Adds `RelOptUtil.pushPastAggregate`, alongside the existing `pushPastProject` / `pushPastCalc`, and
   uses it from `RelMdSelectivity.getSelectivity(Aggregate, ...)` and
   `RelMdDistinctRowCount.getDistinctRowCount(Aggregate, ...)`. The former also has its pushability test
   corrected, from `getGroupSet()` (input indices) to `range(getGroupCount())` (output indices).
   
   Three cases added to `RelMetadataTest`; all three fail without this change. Mechanism, SQL repro and
   downstream impact are in the Jira.
   


-- 
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-7687] RelMdSelectivity and RelMdDistinctRowCount for Aggregate can propagate a predicate with wrong references [calcite]

Posted by "etiennepelissier (via GitHub)" <gi...@apache.org>.
etiennepelissier commented on PR #5145:
URL: https://github.com/apache/calcite/pull/5145#issuecomment-5216956966

   Closing this PR because I will loose access to this GitHub account.


-- 
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-7687] RelMdSelectivity and RelMdDistinctRowCount for Aggregate can propagate a predicate with wrong references [calcite]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5145:
URL: https://github.com/apache/calcite/pull/5145#issuecomment-5168273339

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5145) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5145&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5145&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=5145&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [93.8% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5145&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5145&metric=new_duplicated_lines_density&view=list)  
     
   <!-- sqra-placement-anchor -->
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5145)
   
   


-- 
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-7687] RelMdSelectivity and RelMdDistinctRowCount for Aggregate can propagate a predicate with wrong references [calcite]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5145:
URL: https://github.com/apache/calcite/pull/5145#issuecomment-5167744900

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5145) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5145&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5145&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=5145&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [93.8% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5145&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5145&metric=new_duplicated_lines_density&view=list)  
     
   <!-- sqra-placement-anchor -->
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5145)
   
   


-- 
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-7687] RelMdSelectivity and RelMdDistinctRowCount for Aggregate can propagate a predicate with wrong references [calcite]

Posted by "etiennepelissier (via GitHub)" <gi...@apache.org>.
etiennepelissier closed pull request #5145: [CALCITE-7687] RelMdSelectivity and RelMdDistinctRowCount for Aggregate can propagate a predicate with wrong references
URL: https://github.com/apache/calcite/pull/5145


-- 
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