asterixdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hillery <chill...@hillery.land>
Subject Re: Random element list accessor
Date Wed, 16 Dec 2015 10:59:04 GMT
Well, one of the definitions of random is "unexpected"... and you certainly
wouldn't expect a "random" function to always return the same number. So
I'd say it's functioning as designed.

Ceej
aka Chris Hillery

On Tue, Dec 15, 2015 at 2:54 PM, Mike Carey <dtabass@gmail.com> wrote:

> Nope, seems like that's how it was randomly implemented.  :-)
> Interesting!
> We actually need some random number related functions in our built-in
> library too!
> You caught us with loaded dice.....
>
>
> On 12/15/15 1:24 PM, Ildar Absalyamov wrote:
>
>> Hi all,
>>
>> It was very surprising for me that in addition to regular array-style
>> list accessors (e.g. list[5]) we support special random element accessor
>> (e.g. list[?]), which according to documentation should return random
>> element from the list.
>> However the current implementation ALWAYS returns the first element from
>> the list.
>> Not only this behavior is deterministic, contradicting the semantics of
>> the accessor, but it is also used in the test cases, where it’s used to
>> access elements in the list, containing more then 1 item (e.g.
>> asterix-app/src/test/resources/runtimets/queries/custord/customer_q_06/customer_q_06.3.query.aql).
>>
>> Is there any reason for such implementation, other than someone trowing a
>> dice and considering 1 to be pretty random number to be used? :)
>>
>> Best regards,
>> Ildar
>>
>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message