You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "1fanwang (via GitHub)" <gi...@apache.org> on 2026/08/25 07:23:28 UTC
[PR] [CALCITE-7558] Preserve distinct same-name lattice measures [calcite]
1fanwang opened a new pull request, #5219:
URL: https://github.com/apache/calcite/pull/5219
## Jira Link
[CALCITE-7558](https://issues.apache.org/jira/browse/CALCITE-7558)
## Changes Proposed
A lattice can contain a built-in aggregate and a user-defined aggregate with the same name. `Lattice.Measure.compareTo()` treated those measures as equal even when `SqlOperator.equals()` did not, so the builder's `TreeSet` silently discarded one of them. Current main retains one of three unequal measures in the regression; this branch retains all three.
The natural order still compares arguments, aggregate name, and the distinct flag in the same order as before. Aggregate kind and implementation class now break only ties that previously collapsed unequal measures.
### Testing
```console
$ SOURCE=core/src/main/java/org/apache/calcite/materialize/Lattice.java
$ git checkout c46c70cb26 -- "$SOURCE"
$ JAVA_HOME=$(/usr/libexec/java_home -v 21) ./gradlew :core:test \
--tests 'org.apache.calcite.materialize.LatticeSuggesterTest.testMeasureNaturalOrderingKeepsDistinctAggregatorsWithSameName' \
--no-daemon --console=plain
Expected: a collection with size <3>
but: collection size was <1>
$ git checkout a8981422fa -- "$SOURCE"
$ JAVA_HOME=$(/usr/libexec/java_home -v 21) ./gradlew :core:test \
--tests 'org.apache.calcite.materialize.LatticeSuggesterTest.testMeasureNaturalOrderingKeepsDistinctAggregatorsWithSameName' \
--no-daemon --console=plain
0.1sec, 1 completed, 0 failed, 0 skipped
BUILD SUCCESSFUL
```
--
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-7558] Preserve distinct same-name lattice measures [calcite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5219:
URL: https://github.com/apache/calcite/pull/5219#issuecomment-5407178676
## [](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5219) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5219&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5219&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=5219&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [85.7% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5219&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5219&metric=new_duplicated_lines_density&view=list)
<!-- sqra-placement-anchor -->
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5219)
--
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-7558] Lattice.Measure.compareTo() collapses distinct aggregates that share the same name [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu merged PR #5219:
URL: https://github.com/apache/calcite/pull/5219
--
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