Skip to content

branch-4.1: Add datasketches HLL sketch aggregate functions #63143#63911

Merged
yiguolei merged 1 commit into
branch-4.1from
auto-pick-63143-branch-4.1
Jun 1, 2026
Merged

branch-4.1: Add datasketches HLL sketch aggregate functions #63143#63911
yiguolei merged 1 commit into
branch-4.1from
auto-pick-63143-branch-4.1

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Cherry-picked from #63143

### What problem does this PR solve?

> An aggregate function is required to process user data containing
Datasketches HLL sketches. In many data aggregation scenarios, users
pre‑aggregate detailed data in Hive using the sketching techniques
provided by Apache Datasketches, and then analyze the resulting sketches
across various OLAP engines. Compared with the HLL union aggregate
functions natively offered by these engines, there are two key diff to
using Datasketches HLL sketches: firstly, the use cases differ; and
secondly, HLL sketches can be used seamlessly across different
engines—for example, simultaneously in ES, Doris, and ClickHouse. Such
requirements are common in many production environments.

Issue Number: 
- #63142(#63142)
- #26416
- #56246

Summary:
Implemented a built-in aggregate function that integrates the
Datasketches HLL sketch. This aggregate function cannot rely on the Java
UDF environment. Considering that in the Java UDF environment, Strings
are encoded in UTF-8, which corrupts the binary data of sketches, the
serialization/deserialization operations for sketches must be
implemented on the BE side. (additionally, since Apache Datasketches has
been added to the contrib directory via a git submodule, it will become
very easy to add other sketches such as theta sketch in the future.)

**see**: #63142
**use case**: see regression test &
#63142

---------

Co-authored-by: yuanyuhao <yuanyuhao@bytedance.com>
@github-actions github-actions Bot requested a review from yiguolei as a code owner May 30, 2026 10:38
@hello-stephen
Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@hello-stephen
Copy link
Copy Markdown
Contributor

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 4.00% (1/25) 🎉
Increment coverage report
Complete coverage report

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 72.00% (18/25) 🎉
Increment coverage report
Complete coverage report

@yiguolei yiguolei merged commit ebd75c9 into branch-4.1 Jun 1, 2026
28 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants