array_with_constant
SinceVersion 1.2.0
array_with_constant
description
Syntax
ARRAY<T> array_with_constant(n, T)
get array of constants with n length
notice
Only supported in vectorized engine
example
mysql> set enable_vectorized_engine=true;
mysql> select array_with_constant(2, "hello");
+---------------------------------+
| array_with_constant(2, 'hello') |
+---------------------------------+
| ['hello', 'hello'] |
+---------------------------------+
1 row in set (0.04 sec)
mysql> select array_with_constant(3, 12345);
+-------------------------------+
| array_with_constant(3, 12345) |
+-------------------------------+
| [12345, 12345, 12345] |
+-------------------------------+
1 row in set (0.01 sec)
mysql> select array_with_constant(3, null);
+------------------------------+
| array_with_constant(3, NULL) |
+------------------------------+
| [NULL, NULL, NULL] |
+------------------------------+
1 row in set (0.01 sec)
keywords
ARRAY,WITH_CONSTANT,ARRAY_WITH_CONSTANT