czzmmc opened a new pull request, #22071:
URL: https://github.com/apache/doris/pull/22071

   ## Proposed changes
   
   Issue Number: close #xxx
   
   <!--Describe your changes.-->
   ## Problem summary
   `count_by_enum(expr1, expr2, ... , exprN);`
   
   Treats the data in a column as an enumeration and counts the number of 
values in each enumeration. Returns the number of enumerated values for each 
column, and the number of non-null values versus the number of null values.
   
   #### Arguments
   
   `expr1` — At least one input must be specified. The value is a column of 
type `STRING`.
   
   ##### Returned value
   
   Returns a JSONArray string.
   
   For example:
   ```json
   [{
     "cbe": {
       "F": 100,
       "M": 99
     },
     "notnull": 199,
     "null": 1,
     "all": 200
   }, {
     "cbe": {
       "20": 10,
       "30": 5,
       "35": 1
     },
     "notnull": 16,
     "null": 184,
     "all": 200
   }, {
     "cbe": {
       "China": 10,
       "United States": 9,
       "England": 20,
       "Germany": 30
     },
     "notnull": 69,
     "null": 131,
     "all": 200
   }]
   ```
   Description: The return value is a JSON array string and the order of the 
internal objects is the order of the input parameters.
   * cbe: count of non-null values based on enumeration values
   * notnull: number of non-null values.
   * null: number of null values
   * all: total number, including both null and non-null values.
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at 
[[email protected]](mailto:[email protected]) by explaining why you 
chose the solution you did and what alternatives you considered, etc...
   


-- 
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