Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Refactor to support DataSketches Quantile、Theta、Frequency Sketches #53701

Open
wants to merge 55 commits into
base: main
Choose a base branch
from

Conversation

chenminghua8
Copy link
Contributor

@chenminghua8 chenminghua8 commented Dec 8, 2024

Why I'm doing:

What I'm doing:

In order to support DataSketches Quantile, Theta, and Frequency Sketches, HllSketchAggregateFunction was refactored as follows:

  1. HllSketchAggregateFunction was renamed to DataSketchesAggregateFunction.
  2. The file was renamed from ds_hll_count_distinct.h to ds_agg.h.
  3. Class templates were used to make DataSketchesAggregateFunction support Hll, Quantile, Theta, and Frequency Sketches.
  4. Unit tests for Hll Sketches were added.
  5. Code to support Quantile, Theta, and Frequency Sketches was added to fe to avoid repeated modifications to these files when supporting Quantile, Theta, and Frequency Sketches later.

Fixes #50671

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 3.4
    • 3.3
    • 3.2
    • 3.1
    • 3.0

chenminghua8 and others added 30 commits October 22, 2024 19:10
… Sketches.

Signed-off-by: chenminghua8 <cmptmn@126.com>
Signed-off-by: chenminghua8 <cmptmn@126.com>
Signed-off-by: chenminghua8 <cmptmn@126.com>
Signed-off-by: chenminghua8 <cmptmn@126.com>
Signed-off-by: chenminghua8 <cmptmn@126.com>
Signed-off-by: chenminghua8 <cmptmn@126.com>
Signed-off-by: chenminghua8 <cmptmn@126.com>
Signed-off-by: chenminghua8 <cmptmn@126.com>
Signed-off-by: chenminghua8 <cmptmn@126.com>
Signed-off-by: chenminghua8 <cmptmn@126.com>
Signed-off-by: chenminghua8 <cmptmn@126.com>
Signed-off-by: chenminghua8 <cmptmn@126.com>
… Sketches.

Signed-off-by: chenminghua8 <cmptmn@126.com>
Signed-off-by: chenminghua8 <cmptmn@126.com>
Signed-off-by: chenminghua8 <cmptmn@126.com>
Signed-off-by: chenminghua8 <cmptmn@126.com>
Signed-off-by: chenminghua8 <cmptmn@126.com>
Signed-off-by: chenminghua8 <cmptmn@126.com>
Signed-off-by: chenminghua8 <cmptmn@126.com>
Signed-off-by: chenminghua8 <cmptmn@126.com>
Signed-off-by: chenminghua8 <cmptmn@126.com>
Signed-off-by: chenminghua8 <cmptmn@126.com>
Signed-off-by: chenminghua8 <cmptmn@126.com>
Signed-off-by: chenminghua8 <cmptmn@126.com>
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Dec 8, 2024
Signed-off-by: chenminghua8 <cmptmn@126.com>
Signed-off-by: chenminghua8 <cmptmn@126.com>
Signed-off-by: chenminghua8 <cmptmn@126.com>
@alvin-celerdata
Copy link
Contributor

@chenminghua8 Thank you for your contribution. Every new function should be reviewed and discussed on their interface. Would you like to split this PR into separate PR for each function?

@chenminghua8
Copy link
Contributor Author

@chenminghua8 Thank you for your contribution. Every new function should be reviewed and discussed on their interface. Would you like to split this PR into separate PR for each function?

@alvin-celerdata How about splitting it into the following 4 RPs: 1. Refactor to support Quantile/Theta/Frequency Sketches; 2. Support Theta Sketches; 3. Support Quantile Sketches; 4. Support Frequency Sketches.

@chenminghua8 chenminghua8 changed the title [Feature] (DataSketches) Support Quantile/Theta/Frequency Sketches Aggregate FunctionsSupport data sketches [Feature] Refactor to support DataSketches Quantile、Theta、Frequency Sketches Dec 31, 2024
chenminghua8 and others added 17 commits December 31, 2024 10:32
Copy link

sonarqubecloud bot commented Jan 5, 2025

Copy link

github-actions bot commented Jan 5, 2025

[Java-Extensions Incremental Coverage Report]

pass : 0 / 0 (0%)

Copy link

github-actions bot commented Jan 5, 2025

[FE Incremental Coverage Report]

pass : 24 / 25 (96.00%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/sql/analyzer/FunctionAnalyzer.java 0 1 00.00% [538]
🔵 com/starrocks/sql/optimizer/rule/tree/PreAggregateTurnOnRule.java 3 3 100.00% []
🔵 com/starrocks/catalog/FunctionSet.java 21 21 100.00% []

Copy link

github-actions bot commented Jan 5, 2025

[BE Incremental Coverage Report]

pass : 132 / 140 (94.29%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 be/src/exprs/agg/ds_hll_state.h 62 68 91.18% [75, 76, 77, 78, 80, 81]
🔵 be/src/exprs/agg/ds_agg.h 64 66 96.97% [30, 31]
🔵 be/src/exprs/agg/factory/aggregate_factory.hpp 2 2 100.00% []
🔵 be/src/exprs/agg/factory/aggregate_resolver_approx.cpp 4 4 100.00% []

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Aggregate Function] Support DataSketches in StarRocks
2 participants