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

   # Proposed changes
   1. add the the array_distinct function for array-type which follow spark 
syntax;
   2. we can run this function in sql as follow:
   MySQL [(none)]> set enable_array_type=true;
   
   MySQL [(none)]> set enable_vectorized_engine=true;
   
   MySQL [(none)]> select id, c_array, array_distinct(c_array) from 
example_db.array_test;
   +------+-----------------------------+---------------------------+
   | id   | c_array                     | array_distinct(`c_array`) |
   +------+-----------------------------+---------------------------+
   |    1 | [1, 2, 3, 4, 5]                     | [1, 2, 3, 4, 5]           |
   |    2 | [6, 7, 8]                             | [6, 7, 8]                 |
   |    3 | []                                       | []                       
 |
   |    4 | NULL                                | NULL                      |
   |    5 | [1, 2, 3, 4, 5, 4, 3, 2, 1]    | [1, 2, 3, 4, 5]           |
   |    6 | [1, 2, 3, NULL]                 | [1, 2, 3, NULL]           |
   |    7 | [1, 2, 3, NULL, NULL]      | [1, 2, 3, NULL, NULL]     |
   +------+-----------------------------+---------------------------+
   7 rows in set (0.005 sec)
   
   MySQL [(none)]> select id, c_array, array_distinct(c_array) from 
example_db.array_test01;
   +------+--------------------------+---------------------------+
   | id   | c_array                  | array_distinct(`c_array`) |
   +------+--------------------------+---------------------------+
   |    1 | [a, b, c, d, e]                   | [a, b, c, d, e]           |
   |    2 | [f, g, h]                           | [f, g, h]                 |
   |    3 | []                                     | []                        |
   |    3 | [NULL]                           | [NULL]                    |
   |    5 | [a, b, c, d, e, a, b, c]     | [a, b, c, d, e]           |
   |    6 | NULL                             | NULL                      |
   |    7 | [a, b, NULL]                  | [a, b, NULL]              |
   |    7 | [a, b, NULL, NULL]       | [a, b, NULL, NULL]        |
   +------+--------------------------+---------------------------+
   8 rows in set (0.009 sec)
   
   ## Problem Summary:
   
   Describe the overview of changes.
   
   ## Checklist(Required)
   
   1. Does it affect the original behavior: (No)
   4. Has unit tests been added: (No)
   5. Has document been added or modified: (No)
   6. Does it need to update dependencies: (No)
   7. Are there any changes that cannot be rolled back: (No)
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at 
[d...@doris.apache.org](mailto:d...@doris.apache.org) 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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to