From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 27BCD6F867; Tue, 1 Feb 2022 16:37:22 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 27BCD6F867 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1643722642; bh=P6sv5+cytdbdsHjtRpIqQ1A8PhdSOvejJH0Vi/8kh1Y=; h=To:Cc:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=Z7973Flin25+If/4o//HT3xwm4MgbatbTDUaEMeYC98fUyMKvfX2jT4g81cC9ipOB 6Dm0abOh8J5PoxT2JYwUIS33bXD5yHA3FLjpjaocjkj7Al+Su5nmPZGKMkhZS0gAKM uMc56JPwUrS7yzbNqEZ5VEVjPhjAZNTI5K8RNImk= Received: from smtpng3.i.mail.ru (smtpng3.i.mail.ru [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 3E6836F867 for ; Tue, 1 Feb 2022 16:37:20 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3E6836F867 Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1nEtLT-0007iK-Gn; Tue, 01 Feb 2022 16:37:19 +0300 To: v.shpilevoy@tarantool.org Cc: tarantool-patches@dev.tarantool.org Date: Tue, 1 Feb 2022 16:37:19 +0300 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9C2F57BB0C041E51F235B58B753AEF7B940080F3EBA68232D00894C459B0CD1B954F43309A440BB322AA0B4545B8B912EAA45120333E8030E0B379AF87BB1B6F5 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE72791110C931D1596EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637B2BC59D094D41B978638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D827054C7A8DDD90604E0403D49990165F117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCAA867293B0326636D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8BAA867293B0326636D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B6D635BA3ABDB36C18089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-8FC586DF: 6EFBBC1D9D64D975 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975CCED4562AEA10A75F4B2C7FBE2439E1C7B7752DC6E61B27989C2B6934AE262D3EE7EAB7254005DCED864F6051C41E3F501E0A4E2319210D9B64D260DF9561598F01A9E91200F654B05D065175B8C622778E8E86DC7131B365E7726E8460B7C23C X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34AF12ADB97C97CD89B0F09C7F03CE95A8C15D9F8A0C359FFC000CC93F87A2DF73A686B2B8EE75E3191D7E09C32AA3244C48EE059533E665F7B8355AD22F05CCF94DBEAD0ED6C55A80729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojbL9S8ysBdXgmNuUkUrbSU/pNHz9sbFWo X-Mailru-Sender: 689FA8AB762F739339CABD9B3CA9A7D6249159C377A075FE28F2D93017B343D783D72C36FC87018B9F80AB2734326CD2FB559BB5D741EB96352A0ABBE4FDA4210A04DAD6CC59E3365FEEDEB644C299C0ED14614B50AE0675 X-Mras: Ok Subject: [Tarantool-patches] [PATCH v2 0/4] Introduce custom aggregate function X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Mergen Imeev via Tarantool-patches Reply-To: imeevma@tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" This patch-set introduces user-defined aggregate functions to SQL. Changes in v2: - Patch-set was reworked due to new design. https://github.com/tarantool/tarantool/issues/2579 https://github.com/tarantool/tarantool/tree/imeevma/gh-2579-custom-aggregate-functions Mergen Imeev (4): sql: fix COUNT() optimization conditions sql: drop unnecessary P2 register for OP_AggFinal sql: introduce custom aggregate functions sql: introduce FINALIZE for custom aggregate .../gh-2579-introduce-custom-aggregates.md | 3 + src/box/alter.cc | 13 + src/box/lua/schema.lua | 2 +- src/box/sql/expr.c | 17 +- src/box/sql/func.c | 27 ++- src/box/sql/resolve.c | 12 + src/box/sql/select.c | 42 +++- src/box/sql/sqlInt.h | 6 +- src/box/sql/vdbe.c | 17 +- test/sql-tap/CMakeLists.txt | 2 + test/sql-tap/gh-2579-custom-aggregate.c | 28 +++ .../sql-tap/gh-2579-custom-aggregate.test.lua | 224 ++++++++++++++++++ 12 files changed, 356 insertions(+), 37 deletions(-) create mode 100644 changelogs/unreleased/gh-2579-introduce-custom-aggregates.md create mode 100644 test/sql-tap/gh-2579-custom-aggregate.c create mode 100755 test/sql-tap/gh-2579-custom-aggregate.test.lua -- 2.25.1