IsmailTosunTnyl commented on issue #52252: URL: https://github.com/apache/doris/issues/52252#issuecomment-3016771252
#### its working fine with CTE: ```SQL mysql> WITH simple_test(a) AS ( VALUES (null), ([null,2]), ([20]),([100]),([1,2,3])) SELECT array_agg_foreach(a) FROM simple_test; +-----------------------------------+ | array_agg_foreach(a) | +-----------------------------------+ | [[null, 20, 100, 1], [2, 2], [3]] | +-----------------------------------+ 1 row in set (0.01 sec) ``` ##### When used with a table, it creates a different single element array for each query execution. ```SQL mysql> select * from db; +------+-----------+---------------+ | id | a | s | +------+-----------+---------------+ | 1 | [1, 2, 3] | ["ab", "123"] | | 3 | [100] | ["efg"] | | 2 | [20] | ["cd"] | | 4 | NULL | NULL | | 5 | [null, 2] | [null, "c"] | +------+-----------+---------------+ 5 rows in set (0.01 sec) mysql> select array_agg_foreach(a) from db; +----------------------+ | array_agg_foreach(a) | +----------------------+ | [[20], [2], [3]] | +----------------------+ 1 row in set (0.01 sec) mysql> select array_agg_foreach(a) from db; +----------------------+ | array_agg_foreach(a) | +----------------------+ | [[null], [2], [3]] | +----------------------+ 1 row in set (0.01 sec) mysql> select array_agg_foreach(a) from db; +----------------------+ | array_agg_foreach(a) | +----------------------+ | [[null], [2], [3]] | +----------------------+ 1 row in set (0.01 sec) mysql> select array_agg_foreach(a) from db; +----------------------+ | array_agg_foreach(a) | +----------------------+ | [[100], [2], [3]] | +----------------------+ 1 row in set (0.01 sec) ``` -- 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]
