Tarantool development patches archive
 help / color / mirror / Atom feed
From: Mergen Imeev via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v2 4/4] sql: introduce FINALIZE for custom aggregate
Date: Thu, 10 Feb 2022 12:21:42 +0300	[thread overview]
Message-ID: <20220210092142.GA67603@tarantool.org> (raw)
In-Reply-To: <d6d39667-4a78-8872-0b40-494fbf622fb9@tarantool.org>

hi! Thank you for the review! My answer below.

On Fri, Feb 04, 2022 at 12:30:24AM +0100, Vladislav Shpilevoy wrote:
> Thanks for the patch!
> 
> > Example:
> > ```
> > box.schema.func.create("F1_finalize", {
> >     language = "Lua",
> >     body = [[
> >         function(state)
> >             if state == nil then
> >                 return 0
> >             end
> >             return state.sum / state.count
> >         end
> >     ]],
> >     param_list = {"map"},
> >     returns = "number",
> >     exports = {'LUA', 'SQL'},
> > })
> 
> I thought of another approach - let to call the function any name,
> make {aggregate = "finalize", source = "F1"}. So it is like a foreign
> key. But up to you whether you like it and whether you will try to bring
> it up with the product managers.
> 
I tried two more approaches, but in the end I decided to leave it as it is for
now. Both approaches get too complicated when I have to deal with transactions.

> > box.execute('SELECT f1(i) FROM t;')
> 
> The commit technically LGTM.

  reply	other threads:[~2022-02-10  9:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-01 13:37 [Tarantool-patches] [PATCH v2 0/4] Introduce custom aggregate function Mergen Imeev via Tarantool-patches
2022-02-01 13:37 ` [Tarantool-patches] [PATCH v2 1/4] sql: fix COUNT() optimization conditions Mergen Imeev via Tarantool-patches
2022-02-01 13:37 ` [Tarantool-patches] [PATCH v2 2/4] sql: drop unnecessary P2 register for OP_AggFinal Mergen Imeev via Tarantool-patches
2022-02-01 13:37 ` [Tarantool-patches] [PATCH v2 3/4] sql: introduce custom aggregate functions Mergen Imeev via Tarantool-patches
2022-02-03 23:29   ` Vladislav Shpilevoy via Tarantool-patches
2022-02-01 13:37 ` [Tarantool-patches] [PATCH v2 4/4] sql: introduce FINALIZE for custom aggregate Mergen Imeev via Tarantool-patches
2022-02-03 23:30   ` Vladislav Shpilevoy via Tarantool-patches
2022-02-10  9:21     ` Mergen Imeev via Tarantool-patches [this message]
2022-02-10  9:14 [Tarantool-patches] [PATCH v2 0/4] Introduce custom aggregate functions Mergen Imeev via Tarantool-patches
2022-02-10  9:14 ` [Tarantool-patches] [PATCH v2 4/4] sql: introduce FINALIZE for custom aggregate Mergen Imeev 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=20220210092142.GA67603@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=imeevma@tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2 4/4] sql: introduce FINALIZE for custom aggregate' \
    /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