You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by "leerho (via GitHub)" <gi...@apache.org> on 2026/10/10 22:17:20 UTC
[PR] Check the number of values in array tuple union and intersection [datasketches-cpp]
leerho opened a new pull request, #546:
URL: https://github.com/apache/datasketches-cpp/pull/546
`array_tuple_union::update()` and `array_tuple_intersection::update()` (and so `array_of_doubles_union` and `array_of_doubles_intersection`) now throw `std::invalid_argument` when the sketch's number of values differs from the union or intersection policy's. This matches datasketches-java, where `ArrayOfDoublesUnion.union()` and `ArrayOfDoublesIntersection.intersect()` reject a sketch with a different `numValues`.
Previously the mismatch was not detected and the result was undefined.
The check is in `update()` rather than in the union policy, because entries for new keys are copied into the union without calling the policy, and `get_result()` builds the result with the policy's number of values. As in Java, empty sketches are checked too.
### Tests
New `aod union: number of values` and `aod intersection: number of values` cases in `array_of_doubles_sketch_test.cpp`: matching sketches combine as before; a mismatch is rejected for update and compact sketches, with and without overlapping keys, and for an empty sketch; a union stays usable after a rejected update. Both fail on master and pass here; the full test suite passes (macOS, Debug).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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@datasketches.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org
Re: [PR] Check the number of values in array tuple union and intersection [datasketches-cpp]
Posted by "leerho (via GitHub)" <gi...@apache.org>.
leerho merged PR #546:
URL: https://github.com/apache/datasketches-cpp/pull/546
--
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@datasketches.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org
Re: [PR] Check the number of values in array tuple union and intersection [datasketches-cpp]
Posted by "coveralls (via GitHub)" <gi...@apache.org>.
coveralls commented on PR #546:
URL: https://github.com/apache/datasketches-cpp/pull/546#issuecomment-6102809116
## Coverage Report for [CI Build 38090856549](https://coveralls.io/builds/82281654)
> [!WARNING]
> **Build has drifted**: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
> Quick fix: [rebase this PR](https://github.blog/changelog/2022-02-03-more-ways-to-keep-your-pull-request-branch-up-to-date/#update-your-pull-request-branch-by-rebasing). [Learn more →](https://docs.coveralls.io/build-types#tracking-coverage-changes-with-pull_request-builds)
### Coverage increased (+**0.01%**) to **82.388%**
### Details
- Coverage increased (+0.01%) from the [base build](https://coveralls.io/builds/82189941).
- **Patch coverage**: **14** of **14** lines across **2** files are fully covered (100%).
- No coverage regressions found.
### Uncovered Changes
No uncovered changes found.
### Coverage Regressions
No coverage regressions found.
---
### Coverage Stats
| | [](https://coveralls.io/builds/82281654) |
| :-- | --: |
| Relevant Lines: | 21446 |
| Covered Lines: | 17669 |
| Line Coverage: | 82.39% |
| Coverage Strength: | 1371952.81 hits per line |
---
##### 💛 - [Coveralls](https://coveralls.io)
--
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@datasketches.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org