Tarantool development patches archive
 help / color / mirror / Atom feed
From: Mergen Imeev via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Konstantin Osipov <kostja.osipov@gmail.com>
Cc: v.shpilevoy@tarantool.org, tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v1 1/2] sql: introduce field type ARRAY
Date: Wed, 3 Nov 2021 17:27:42 +0300	[thread overview]
Message-ID: <20211103142742.GA177463@tarantool.org> (raw)
In-Reply-To: <20211103135327.GB396206@starling>

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@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

  reply	other threads:[~2021-11-03 14:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-03  8:17 [Tarantool-patches] [PATCH v1 0/2] Introduce field type ARRAY to SQL Mergen Imeev via Tarantool-patches
2021-11-03  8:17 ` [Tarantool-patches] [PATCH v1 1/2] sql: introduce field type ARRAY Mergen Imeev via Tarantool-patches
2021-11-03 12:09   ` Mergen Imeev via Tarantool-patches
2021-11-03 13:53   ` Konstantin Osipov via Tarantool-patches
2021-11-03 14:27     ` Mergen Imeev via Tarantool-patches [this message]
2021-11-03 14:33       ` Konstantin Osipov via Tarantool-patches
2021-11-14 16:12   ` Vladislav Shpilevoy via Tarantool-patches
2021-11-15 16:38     ` Mergen Imeev via Tarantool-patches
2021-11-03  8:17 ` [Tarantool-patches] [PATCH v1 2/2] sql: introduce ARRAY() function Mergen Imeev via Tarantool-patches
2021-11-03 12:11   ` Mergen Imeev via Tarantool-patches
2021-11-14 16:12   ` Vladislav Shpilevoy via Tarantool-patches
2021-11-15 16:40     ` Mergen Imeev via Tarantool-patches
2021-11-18 21:19 ` [Tarantool-patches] [PATCH v1 0/2] Introduce field type ARRAY to SQL Vladislav Shpilevoy via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211103142742.GA177463@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=imeevma@tarantool.org \
    --cc=kostja.osipov@gmail.com \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v1 1/2] sql: introduce field type ARRAY' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox