-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[BugFix] Support compression factor for percentile_approx #54115
Conversation
@INNOCENT-BOY add some tests in test/sql/test_agg_function/T/test_percentile_approx |
@INNOCENT-BOY clang-format check fails, please fix the code style according to the check. |
\
I have added some test sql in tes_percentile_approx. Please check again. |
Hi @satanson , please review this pr again when you are free. Thanks in advance. |
@INNOCENT-BOY /home/runner/_work/starrocks/starrocks/be/src/util/percentile_value.h had clang-format style issues
--- /home/runner/_work/starrocks/starrocks/be/src/util/percentile_value.h
/home/runner/_work/starrocks/starrocks/be/src/exprs/agg/percentile_approx.h had clang-format style issues
+++ /home/runner/_work/starrocks/starrocks/be/src/util/percentile_value.h (after clang format)
@@ -21,[9](https://github.com/StarRocks/starrocks/actions/runs/12490410567/job/34855175667?pr=54115#step:6:10) +21,7 @@
public:
PercentileValue() { _type = TDIGEST; }
- explicit PercentileValue(double compression) : _tdigest(compression) {
- _type = TDIGEST;
- }
+ explicit PercentileValue(double compression) : _tdigest(compression) { _type = TDIGEST; }
explicit PercentileValue(const Slice& src) {
switch (*src.data) {
--- /home/runner/_work/starrocks/starrocks/be/src/exprs/agg/percentile_approx.h
+++ /home/runner/_work/starrocks/starrocks/be/src/exprs/agg/percentile_approx.h (after clang format)
@@ -59,7 +59,7 @@
compression = ColumnHelper::get_const_value<TYPE_DOUBLE>(ctx->get_constant_column(2));
if (compression < MIN_COMPRESSION || compression > MAX_COMPRESSION) {
LOG(WARNING) << "Compression factor out of range. Using default compression factor: "
- << DEFAULT_COMPRESSION_FACTOR;
+ << DEFAULT_COMPRESSION_FACTOR;
compression = DEFAULT_COMPRESSION_FACTOR;
}
} |
Hi @stdpain , I have fixed format issue, please check again. |
@LiShuMing be crash in MV cases, help plz |
public: | ||
void create(FunctionContext* ctx, AggDataPtr __restrict ptr) const override { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you give a default compression
if ctx
is null because agg_state
in common aggregate state it may be null.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
Hi @kevincai @LiShuMing @stdpain , please help review this pr again. |
@INNOCENT-BOY check the test case: test_agg_state_table_with_all_functions |
@mergify rebase |
✅ Branch has been successfully rebased |
I found a bug in original sql test, you can rebase the code after pr(#54556) is merged. |
@mergify rebase |
✅ Branch has been successfully rebased |
Hi @LiShuMing @satanson ,What do I need to do to get this PR merged? |
[Java-Extensions Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[FE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[BE Incremental Coverage Report]✅ pass : 13 / 16 (81.25%) file detail
|
Why I'm doing:
I found that the runtime of compression_factor in percentile_approx hardly changes.
What I'm doing:
According to the official documentation, we can see that the percentile_approx function allows adjusting the compression. However, during actual debugging, I found that the compression remains fixed at 1000. Therefore, I implemented the content described in the function's documentation.
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: