array_with_constant

SinceVersion 1.2.0

array_with_constant

description

Syntax

1. ARRAY<T> array_with_constant(n, T)

get array of constants with n length

notice

Only supported in vectorized engine

example

1. mysql> set enable_vectorized_engine=true;

3. mysql> select array_with_constant(2, "hello");
4. +---------------------------------+
5. | array_with_constant(2, 'hello') |
6. +---------------------------------+
7. | ['hello', 'hello']              |
8. +---------------------------------+
9. 1 row in set (0.04 sec)

11. mysql> select array_with_constant(3, 12345);
12. +-------------------------------+
13. | array_with_constant(3, 12345) |
14. +-------------------------------+
15. | [12345, 12345, 12345]         |
16. +-------------------------------+
17. 1 row in set (0.01 sec)

19. mysql> select array_with_constant(3, null);
20. +------------------------------+
21. | array_with_constant(3, NULL) |
22. +------------------------------+
23. | [NULL, NULL, NULL]           |
24. +------------------------------+
25. 1 row in set (0.01 sec)

keywords

ARRAY,WITH_CONSTANT,ARRAY_WITH_CONSTANT