Re: [Maria-developers] Aggregate Stored Functions

2016-06-06 Thread Vicențiu Ciorbaru
Hi Varun, I prefer to split up tests. However for this is case you can potentially have them all in one place since they work together. Vicentiu On Mon, 6 Jun 2016 at 10:41, Varun Gupta wrote: > Hi, > I have added the test where I have put both ALTER,CREATE and SHOW FUNCTION > queries. Should I m

Re: [Maria-developers] Aggregate Stored Functions

2016-06-06 Thread Varun Gupta
Hi, I have added the test where I have put both ALTER,CREATE and SHOW FUNCTION queries. Should I make separate test for the queries or clubbing them in one is fine . On Sat, Jun 4, 2016 at 7:25 PM, Varun Gupta wrote: > Hi, > I have also written a test for the alter, show and create functions.

Re: [Maria-developers] Aggregate Stored Functions

2016-05-26 Thread Varun Gupta
Hi, Regarding the plan for pausing and restarting the execution of the function when we have to fetch a row, 1) is that we escape from the function when we come across a FETCH GROUP statement , a state could be defined in thd->lex->sphead which would tell that the function is paused and then we pro

Re: [Maria-developers] Aggregate Stored Functions

2016-05-24 Thread Sanja
Hi! I reviewed yet another time the code and have following toughts: a) if we store the tag separately (like deterministic or not) then separate field is better b) If we get the value form function content then flag is what we need. for now we are going by a) i.e. we clearly in the header of th

Re: [Maria-developers] Aggregate Stored Functions

2016-05-24 Thread Vicențiu Ciorbaru
Hi Varun, I've reviewed your patch. Looks good from my side. Just stylistic comments. Feel free to keep your own version if you don't agree with them. I think that you could have used the m_flags field, but having a specific member makes things a lot clearer in my opinion. Perhaps Sanja has a dif

Re: [Maria-developers] Aggregate Stored Functions

2016-05-24 Thread Sanja
Yes, the decision is right. I'll check later the code on github. On Tue, May 24, 2016 at 10:27 AM, Varun Gupta wrote: > Hi, > I had been going through the LEX struct and could not find any flag member > there which could be used to specify if a function is aggregate or not. So > i created the ne

Re: [Maria-developers] Aggregate Stored Functions

2016-05-24 Thread Varun Gupta
Hi, I had been going through the LEX struct and could not find any flag member there which could be used to specify if a function is aggregate or not. So i created the new flag inside sp_head, so as to make sure it could be used for stored procedures too in the future. I have committed the changes

Re: [Maria-developers] Aggregate Stored Functions

2016-05-23 Thread Vicențiu Ciorbaru
Hi Varun, Getting the parser to accept the syntax is a good first step. Writing tests is the correct way to go also. Now we need to have a way to pass this extra information to the part of the code that stores / executes this procedure. When we encounter this AGGREGATE_SYM syntax we have to recor

Re: [Maria-developers] Aggregate Stored Functions

2016-05-22 Thread Varun Gupta
Hi, As in my previous mail I have added the FETCH statement to the parser and have tested it, when the syntax is correct . Now I am writing test that would also give an error for incorrect syntax. Also I would like how to proceed further :). ___ Mailing l

Re: [Maria-developers] Aggregate Stored Functions

2016-05-21 Thread Varun Gupta
Hi, I have added FETCH GROUP NEXT ROW to the parser and have tested it. I have also made changes according to the review to my first. New commit https://github.com/MariaDB/server/commit/65782a2a6b5ad3db466953b6ea46f87de2616723 On Fri, May 20, 2016 at 11:18 AM, Vicențiu Ciorbaru wrote: > Hi Sanj

Re: [Maria-developers] Aggregate Stored Functions

2016-05-19 Thread Vicențiu Ciorbaru
Hi Sanja, Since we have not officially started the coding period, I figured that an exercise in adding a parser syntax would be a good first step. We can do automatic detection by looking at the cursor without to much extra work. Vicentiu On Fri, 20 May 2016 at 08:29, Sanja wrote: > Hi! > > H

Re: [Maria-developers] Aggregate Stored Functions

2016-05-19 Thread Sanja
Hi! Have you read our discussion about automatic aggregate functions detection? Am 20.05.2016 07:15 schrieb "Varun Gupta" : > Hi, > I have added the AGGREGATE keyword to the parser . Here is the link to the > repository https://github.com/varunraiko/aggregate-functions . > > > On Wed, May 18, 201

Re: [Maria-developers] Aggregate Stored Functions

2016-05-19 Thread Varun Gupta
Hi, I have added the AGGREGATE keyword to the parser . Here is the link to the repository https://github.com/varunraiko/aggregate-functions . On Wed, May 18, 2016 at 9:50 PM, Sanja wrote: > Hi! > > If we get it automatically then of course it should be done, but I > doubts... We will see. > > O

Re: [Maria-developers] Aggregate stored functions [MDEV-7773]

2016-03-22 Thread Varun Gupta
Hi Sergei, Sorry for the inconvenience , now you can comment on the document :) On Tue, Mar 22, 2016 at 1:25 PM, Sergei Golubchik wrote: > Hi, Varun! > > On Mar 22, Varun Gupta wrote: > > Hi Sergei , > > I have created a draft proposal and submitted to summerofcode website. > > I haven't written

Re: [Maria-developers] Aggregate stored functions [MDEV-7773]

2016-03-22 Thread Sergei Golubchik
Hi, Varun! On Mar 22, Varun Gupta wrote: > Hi Sergei , > I have created a draft proposal and submitted to summerofcode website. > I haven't written the project timeline yet. Please I would appreciate > if you could go through it and leave comments so that I can make any > necessary corrections. I

Re: [Maria-developers] Aggregate stored functions [MDEV-7773]

2016-03-21 Thread Varun Gupta
Hi Sergei , I have created a draft proposal and submitted to summerofcode website. I haven't written the project timeline yet. Please I would appreciate if you could go through it and leave comments so that I can make any necessary corrections. On Mon, Mar 21, 2016 at 2:34 PM, Sergei Golubchik w

Re: [Maria-developers] Aggregate stored functions [MDEV-7773]

2016-03-21 Thread Sergei Golubchik
Hi, Varun! On Mar 21, Varun Gupta wrote: > Hi Sergei, > > 4) :create an Item_sum_sp to be able to use aggregate stored functions in >queries. > Does this mean we can have the aggregate stored functions in the SELECT , > WHERE etc clauses?can you give me more details about this. Yes, of cours

Re: [Maria-developers] Aggregate stored functions [MDEV-7773]

2016-03-19 Thread Sergei Golubchik
Hi, Varun! On Mar 19, Varun Gupta wrote: > Hi Sergei, > I have gone through the code you suggested. I have got a good understanding > of what the code actually does. So now I wanted to start writing the > proposal for the idea. Can you tell me what all is needed to written in the > proposal. I am

Re: [Maria-developers] Aggregate stored functions [MDEV-7773]

2016-03-18 Thread Varun Gupta
Hi Sergei, I have gone through the code you suggested. I have got a good understanding of what the code actually does. So now I wanted to start writing the proposal for the idea. Can you tell me what all is needed to written in the proposal. I am asking for a template or something that could guide

Re: [Maria-developers] Aggregate stored functions [MDEV-7773]

2016-03-06 Thread Varun Gupta
Hi Sergei, Thanks that answers my question, I will soon get back with questions . On Sun, Mar 6, 2016 at 2:52 PM, Sergei Golubchik wrote: > Hi, Varun! > > On Mar 06, Varun Gupta wrote: > > Hi Sergei, > > I understand that having a cursor like syntax we would have to write > some > > new code .

Re: [Maria-developers] Aggregate stored functions [MDEV-7773]

2016-03-06 Thread Sergei Golubchik
Hi, Varun! On Mar 06, Varun Gupta wrote: > Hi Sergei, > I understand that having a cursor like syntax we would have to write some > new code . What I would have liked to know is that the more details should > be discussed which need to be incorporated in the implementation of the > aggregate func

Re: [Maria-developers] Aggregate stored functions [MDEV-7773]

2016-03-05 Thread Varun Gupta
Hi Sergei, I understand that having a cursor like syntax we would have to write some new code . What I would have liked to know is that the more details should be discussed which need to be incorporated in the implementation of the aggregate functions. Basically what I am asking is what all detai

Re: [Maria-developers] Aggregate stored functions [MDEV-7773]

2016-03-04 Thread Sergei Golubchik
Hi, Varun! On Mar 04, Varun Gupta wrote: > With the syntax more or less clear to us, can we have a discussion about > how we have to go on with the implementation for the aggregate functions. > Firstly I thought I should look at the implementation of CREATE FUNCTION, > any other suggestions ? Sur

Re: [Maria-developers] Aggregate stored functions [MDEV-7773]

2016-03-03 Thread Varun Gupta
With the syntax more or less clear to us , can we have a discussion about how we have to go on with the implementation for the aggregate functions. Firstly I thought I should look at the implementation of CREATE FUNCTION, any other suggestions ? On Thu, Mar 3, 2016 at 4:56 PM, Varun Gupta wrote:

Re: [Maria-developers] Aggregate stored functions [MDEV-7773]

2016-03-03 Thread Varun Gupta
With the cursor approach, I think it looks more easier to understand . Also it covers the point that the state has to be saved when the function is called for different values of x ,so we know the approach is correct. We are using the function attribute X in calculating the sum. I don't understand

Re: [Maria-developers] Aggregate stored functions [MDEV-7773]

2016-03-02 Thread Sergei Golubchik
Hi, Varun! On Mar 02, Varun Gupta wrote: > Well in HSQL we have the limitation of having maximum of 4 arguments , but > in our syntax we can increase the number of arguments.The main thing is > what I understood from HSQL and PostgreSQL is that an aggregate function > would have 2 states. > 1) wh

Re: [Maria-developers] Aggregate stored functions [MDEV-7773]

2016-03-02 Thread Varun Gupta
Well in HSQL we have the limitation of having maximum of 4 arguments , but in our syntax we can increase the number of arguments.The main thing is what I understood from HSQL and PostgreSQL is that an aggregate function would have 2 states. 1) when we compute the result that is the result keeps on

Re: [Maria-developers] Aggregate stored functions [MDEV-7773]

2016-03-02 Thread Sergei Golubchik
Hi, Varun! On Mar 02, Varun Gupta wrote: > Well i have checked out the syntax for the databases for aggregate > functions. I thought using the syntax similar to that of HSQL would be > good. In it if we are having N tuples then we are computing the values for > the N rows and then after that we ma

[Maria-developers] Aggregate stored functions [MDEV-7773]

2016-03-02 Thread Varun Gupta
Well i have checked out the syntax for the databases for aggregate functions. I thought using the syntax similar to that of HSQL would be good. In it if we are having N tuples then we are computing the values for the N rows and then after that we make another call and return the value for the funct