emerkfu opened a new issue, #11560:
URL: https://github.com/apache/doris/issues/11560

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/incubator-doris/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### Description
   
   Now Doris has supported the window_funnel function. The window_funnel 
function can calculate the depth of the ordered window funnel. If only the 
depth of the funnel is used, it is still difficult to calculate the conversion 
rate of each layer of funnel. If the following three functions can be 
supported, the calculation of the conversion rate of each layer of funnel It 
will be easy to support, and the calculation of retention analysis can also be 
implemented.
   
   ```
   array_with_constant(length, param)
   array_enumerate(arr)
   array_join(arr)
   ```
   
   ### Use case
   
   **array_with_constant(length, param)**
   
   description
   ```
   Syntax
   ARRAY<T> array_with_constant(BIGINT length, T param)
   ```
   
   Returns an array of the specified length.
   length: The length of the array.
   param: filled content.
   
   _example_
   
   ```
   mysql> select k1, k2, array_with_constant(k1, k2) from 
array_with_constant_demo_table;
   +-----------------+-----------------+-----------------------------+
   | k1              | k2              | array_with_constant(k1, k2) |
   +-----------------+-----------------+-----------------------------+
   | 4               | 1               | [1,1,1,1]                   |
   +-----------------+-----------------+-----------------------------+
   ```
   ---
   **array_enumerate(arr)**
   
   description
   ```
   Syntax
   ARRAY<T> array_enumerate(ARRAY<T> arr)
   ```
   
   Returns an array of subscript values of the target array.
   
   _example_
   ```
   mysql> select k1, array_enumerate([1, 1, 1, 1]) from 
array_enumerate_demo_table;
   +-----------------+---------------------+
   | k1              | array_enumerate(k1) |
   +-----------------+---------------------+
   | [1, 1, 1, 1]    | [1,2,3,4]           |
   | NULL            | NULL                |
   +-----------------+---------------------+
   ```
   ---
   **array_join(arr)**
   
   description
   ```
   Syntax
   T array_join(ARRAY<T> arr)
   ```
   
   Returns the expanded result of an array into multiple lines.
   
   example
   
   ```
   mysql> select k1, k2, array_join(k2) from array_join_demo_table;
   +-----------------+---------------------+----------------+
   | k1              | k2                  | array_join(k2) |
   +-----------------+---------------------+----------------+
   | a1              | [1,2,3,4]           | 1              |
   | a1              | [1,2,3,4]           | 2              |
   | a1              | [1,2,3,4]           | 3              |
   | a1              | [1,2,3,4]           | 4              |
   +-----------------+---------------------+----------------+
   ```
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to