[Tarantool-patches] [PATCH v1 1/2] sql: introduce field type ARRAY

Mergen Imeev imeevma at tarantool.org
Wed Nov 3 17:27:42 MSK 2021

Hi! Thank you for the advice. My answer below.

On Wed, Nov 03, 2021 at 04:53:27PM +0300, Konstantin Osipov wrote:
> * Mergen Imeev via Tarantool-patches <tarantool-patches at dev.tarantool.org> [21/11/03 11:22]:
> > This patch introduces ARRAY to SQL. After this patch, all SQL operations
> > and built-in functions should work correctly with ARRAY values. However,
> > there is currently no way to create ARRAY values using only SQL tools.
> The entire industry is using [] for array subscript and {} for map
> subscript. Why did you have to invent () for it?
Here we have a user-defined function a1() that takes one argument and returns an
ARRAY containing a single element that was given as an argument. There are also
two more functions: a2(), which takes two arguments, and a3(), which takes three
arguments. They work the same way. I created them to test if ARRAY works as
intended. The built-in ARRAY() function takes 1 to 127 arguments and returns
ARRAY, which contains the values passed as arguments to the function.

This patch-set is just a part of the ARRAY addition, and we plan to add [] for
ARRAY and {} for MAP a little later, after we have built-in functions ARRAY()
and MAP().

Or did you mean something else?

> > +        SELECT a1(1) == CAST(1 AS SCALAR);
> -- 
> Konstantin Osipov, Moscow, Russia

More information about the Tarantool-patches mailing list