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