FearfulTomcat27 opened a new pull request, #15338: URL: https://github.com/apache/iotdb/pull/15338
This pull request introduces the `ApproxCountDistinctAccumulator` and its associated classes to support the `APPROX_COUNT_DISTINCT` aggregation function in the IoTDB query engine. The changes include the addition of new classes and modifications to existing factory methods to incorporate the new accumulator. ### Key Changes: **New Classes:** * [`ApproxCountDistinctAccumulator`](diffhunk://#diff-24c6e2b1ec5522790e49b72c6a8fb6c2c7618905a685fa633552ee87709b1200R1-R262): Implements the logic for the `APPROX_COUNT_DISTINCT` aggregation function, including methods for adding input data, merging intermediate results, and evaluating the final result. * [`HyperLogLog`](diffhunk://#diff-e386b0d69ef98e3c9b262715f258c19fb22e033a82364a7143bfdf3285f1e3b3R1-R265): A probabilistic data structure used by `ApproxCountDistinctAccumulator` to estimate the cardinality of a data set. * [`HyperLogLogState`](diffhunk://#diff-94b57fed7afe58c5d62e6365e974c260803db68d9e30f933861aa9a79b52e77bR1-R7): An interface for managing the state of `HyperLogLog` instances. * [`HyperLogLogStateFactory`](diffhunk://#diff-f6618410182b079e5cb6c44a2d31ecd55dcadf8a0cdc26c268765cf318bd5503R1-R89): Provides factory methods to create and manage `HyperLogLog` states, including single and grouped states. **Factory Method Modifications:** * [`AccumulatorFactory.java`](diffhunk://#diff-a72623b1eb8bac3f674e3b12529635a4ebd66a0c5763e40878249d13bd6e6068R244-R245): Updated to include cases for `APPROX_COUNT_DISTINCT` in the `createBuiltinGroupedAccumulator` and `createBuiltinAccumulator` methods. [[1]](diffhunk://#diff-a72623b1eb8bac3f674e3b12529635a4ebd66a0c5763e40878249d13bd6e6068R244-R245) [[2]](diffhunk://#diff-a72623b1eb8bac3f674e3b12529635a4ebd66a0c5763e40878249d13bd6e6068R311-R312) -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
