Skip to content

[Feature](func) Support function QUANTILE_STATE_TO/FROM_BASE64 - #59607

Closed
linrrzqqq wants to merge 1 commit into
apache:branch-2.1from
linrrzqqq:qts-bash64
Closed

[Feature](func) Support function QUANTILE_STATE_TO/FROM_BASE64#59607
linrrzqqq wants to merge 1 commit into
apache:branch-2.1from
linrrzqqq:qts-bash64

Conversation

@linrrzqqq

@linrrzqqqlinrrzqqq commented Jan 6, 2026

Copy link
Copy Markdown
Collaborator

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

Release note

doc:apache/doris-website#3279

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@Thearas

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?

Comment threadregression-test/conf/regression-conf.groovy
@linrrzqqq

Copy link
Copy Markdown
CollaboratorAuthor

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 42.53% (37/87) 🎉

Increment coverage report
Complete coverage report

CategoryCoverage
Function Coverage39.15% (10403/26575)
Line Coverage30.12% (86258/286372)
Region Coverage27.67% (49798/179968)
Branch Coverage24.23% (24436/100844)

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds two new SQL functions quantile_state_to_base64 and quantile_state_from_base64 to enable serialization and deserialization of quantile state objects to/from base64-encoded strings, facilitating storage and transmission of quantile state data.

Key Changes:

  • Added quantile_state_to_base64 function to convert QUANTILE_STATE objects to base64 strings
  • Added quantile_state_from_base64 function to convert base64 strings back to QUANTILE_STATE objects
  • Implemented comprehensive test coverage including unit tests and regression tests

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
FileDescription
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/QuantileStateToBase64.javaFrontend implementation for quantile_state_to_base64 function with PropagateNullable semantics
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/QuantileStateFromBase64.javaFrontend implementation for quantile_state_from_base64 function with AlwaysNullable semantics
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/visitor/ScalarFunctionVisitor.javaAdded visitor methods for the new quantile state functions
fe/fe-core/src/main/java/org/apache/doris/catalog/BuiltinScalarFunctions.javaRegistered the new quantile state functions in the function registry
be/src/vec/functions/function_quantile_state.cppBackend implementation of the serialization and deserialization logic with base64 encoding/decoding
be/test/vec/function/function_test_util.cppAdded QuantileState type support to the function testing framework
be/test/vec/function/function_quantile_state_test.cppComprehensive unit tests covering empty states, single/multi-value states, explicit states, and round-trip conversions
regression-test/suites/query_p0/sql_functions/quantile_state_functions/test_quantile_state_function.groovyEnd-to-end regression tests covering NULL handling, invalid inputs, and round-trip conversions
regression-test/data/query_p0/sql_functions/quantile_state_functions/test_quantile_state_function.outExpected output for regression tests

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadbe/src/vec/functions/function_quantile_state.cpp
@github-actions

Copy link
Copy Markdown
Contributor

PR approved by at least one committer and no changes requested.

@github-actionsgithub-actionsBot added approved Indicates a PR has been approved by one committer. reviewed labels Jan 7, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@HappenLeeHappenLee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zclllyybbzclllyybb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

yiguolei pushed a commit that referenced this pull request Jan 12, 2026
### What problem does this PR solve?
Issue Number: close #xxx
Related PR: #59607 Problem Summary:
### Release note
None
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [x] Regression test
- [ ] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason <!-- Add your reason? -->
- Behavior changed:
- [ ] No.
- [ ] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
github-actionsBot pushed a commit that referenced this pull request Jan 12, 2026
### What problem does this PR solve?
Issue Number: close #xxx
Related PR: #59607 Problem Summary:
### Release note
None
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [x] Regression test
- [ ] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason <!-- Add your reason? -->
- Behavior changed:
- [ ] No.
- [ ] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
zzzxl1993 pushed a commit to zzzxl1993/doris that referenced this pull request Jan 13, 2026
…e#59664)
### What problem does this PR solve?
Issue Number: close #xxx
Related PR: apache#59607 Problem Summary:
### Release note
None
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [x] Regression test
- [ ] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason <!-- Add your reason? -->
- Behavior changed:
- [ ] No.
- [ ] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
@linrrzqqq
linrrzqqq deleted the qts-bash64 branch January 22, 2026 06:25
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approvedIndicates a PR has been approved by one committer.reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@linrrzqqq@Thearas@hello-stephen@BiteTheDDDDt@HappenLee@zclllyybb