Skip to content

Conversation

@github-actions
Copy link
Contributor

Cherry-picked from #56798

`EXPORT_SET` is used to convert each bit of an integer into a specified
string and concatenate them into a result string. For each bit in `bits`
that is 1, the corresponding position in the result will display the
`on` string; for each bit that is 0, the `off` string will be displayed.
The bits are checked in order from right to left (i.e., from the least
significant bit to the most significant bit), but concatenated into the
result string from left to right. The bits are separated by the
`separator` (default is a comma `,`).

```text
mysql> SELECT EXPORT_SET(5, '1', '0');
+---------------------------------------------------------------------------------------------------------------------------------+
| EXPORT_SET(5, '1', '0')                                                                                                         |
+---------------------------------------------------------------------------------------------------------------------------------+
| 1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
+---------------------------------------------------------------------------------------------------------------------------------+

mysql> SELECT EXPORT_SET(-1, '1', '0', ',');
+---------------------------------------------------------------------------------------------------------------------------------+
| EXPORT_SET(-1, '1', '0', ',')                                                                                                   |
+---------------------------------------------------------------------------------------------------------------------------------+
| 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 |
+---------------------------------------------------------------------------------------------------------------------------------+

mysql> SELECT EXPORT_SET(5, '1', '0', '|', 5);
+---------------------------------+
| EXPORT_SET(5, '1', '0', '|', 5) |
+---------------------------------+
| 1|0|1|0|0                       |
+---------------------------------+

mysql> SELECT EXPORT_SET(5, 'apache', 'doris', '123', 5);
+--------------------------------------------+
| EXPORT_SET(5, 'apache', 'doris', '123', 5) |
+--------------------------------------------+
| apache123doris123apache123doris123doris    |
+--------------------------------------------+
```
@github-actions github-actions bot requested a review from yiguolei as a code owner October 24, 2025 04:15
@hello-stephen
Copy link
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?

@dataroaring dataroaring reopened this Oct 24, 2025
@hello-stephen
Copy link
Contributor

run buildall

@yiguolei yiguolei merged commit bdad5a5 into branch-4.0 Oct 24, 2025
23 of 27 checks passed
@github-actions github-actions bot deleted the auto-pick-56798-branch-4.0 branch October 24, 2025 09:20
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.

5 participants