Re: poc - possibility to write window function in PL languages

From: Zhihong Yu <zyu(at)yugabyte(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: poc - possibility to write window function in PL languages
Date: 2021-01-04 17:38:02
Message-ID: CALNJ-vQwNOhjSnnfqMkeP29vrzxvHWVBPS4ov4Lv=JM=Oto_Lw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi, Pavel:
Thanks for the update.

I don't have other comment.

Cheers

On Mon, Jan 4, 2021 at 3:15 AM Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
wrote:

> Hi
>
> pá 1. 1. 2021 v 18:57 odesílatel Zhihong Yu <zyu(at)yugabyte(dot)com> napsal:
>
>> Hi, Pavel:
>> Happy New Year.
>>
>> + command with clause <literal>WINDOW</literal>. The specific feature of
>> + this functions is a possibility to two special storages with
>>
>> this functions -> this function
>>
>> possibility to two special storages: there is no verb.
>>
>> 'store with stored one value': store is repeated.
>>
>> + * Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group
>>
>> It would be better to change 2020 to 2021 in the new files.
>>
>
> fixed
>
>>
>> For some functions, such as windowobject_get_func_arg_frame, it would be
>> better to add comment explaining their purposes.
>>
>
> It is commented before. These functions just call WinAPI functions
>
> /*
> * High level access function. These functions are wrappers for windows API
> * for PL languages based on usage WindowObjectProxy.
> */
>
>
>
>> For estimate_partition_context_size():
>> + errmsg("size of value is greather than limit (1024
>> bytes)")));
>>
>> Please include the value of typlen in the message. There is similar error
>> message in the else block where value of size should be included.
>>
>> + return *realsize;
>> + }
>> + else
>>
>> The 'else' is not needed since the if block ends with return.
>>
>
> yes, but it is there for better readability (symmetry)
>
>>
>> + size += size / 3;
>>
>> Please add a comment for the choice of constant 3.
>>
>> + /* by default we allocate 30 bytes */
>> + *realsize = 0;
>>
>> The value 30 may not be accurate - from the caller:
>>
>> + if (PG_ARGISNULL(2))
>> + minsize = VARLENA_MINSIZE;
>> + else
>> + minsize = PG_GETARG_INT32(2);
>>
>> VARLENA_MINSIZE is 32.
>>
>> Cheers
>>
>> On Fri, Jan 1, 2021 at 3:29 AM Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
>> wrote:
>>
>>> Hi
>>>
>>> rebase
>>>
>>> Regards
>>>
>>> Pavel
>>>
>>
> I am sending updated patch
>
> Thank you for comments
>
> Regards
>
> Pavel
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2021-01-04 17:54:04 Re: Proposed patch for key management
Previous Message Dean Rasheed 2021-01-04 17:24:08 Bug in numeric_power() if exponent is INT_MIN