Syntax

    1. mysql> set enable_vectorized_engine=true;
    2. mysql> select k1, k2, array_sort(k2) array_test;
    3. +------+-----------------------------+-----------------------------+
    4. | k1 | k2 | array_sort(`k2`) |
    5. +------+-----------------------------+-----------------------------+
    6. | 2 | [6, 7, 8] | [6, 7, 8] |
    7. | 3 | [] | [] |
    8. | 4 | NULL | NULL |
    9. | 6 | [1, 2, 3, NULL] | [NULL, 1, 2, 3] |
    10. | 7 | [1, 2, 3, NULL, NULL] | [NULL, NULL, 1, 2, 3] |
    11. | 8 | [1, 1, 2, NULL, NULL] | [NULL, NULL, 1, 1, 2] |
    12. | 9 | [1, NULL, 1, 2, NULL, NULL] | [NULL, NULL, NULL, 1, 1, 2] |
    13. +------+-----------------------------+-----------------------------+
    14. +------+------------------------------------------+------------------------------------------+
    15. | k1 | k2 | array_sort(`k2`) |
    16. | 1 | ['a', 'b', 'c', 'd', 'e'] | ['a', 'b', 'c', 'd', 'e'] |
    17. | 2 | ['f', 'g', 'h'] | ['f', 'g', 'h'] |
    18. | 3 | [''] | [''] |
    19. | 3 | [NULL] | [NULL] |
    20. | 5 | ['a', 'b', 'c', 'd', 'e', 'a', 'b', 'c'] | ['a', 'a', 'b', 'b', 'c', 'c', 'd', 'e'] |
    21. | 6 | NULL | NULL |
    22. | 7 | ['a', 'b', NULL] | [NULL, 'a', 'b'] |
    23. +------+------------------------------------------+------------------------------------------+