You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by Chunhui Shi <cs...@maprtech.com> on 2016/05/26 19:46:56 UTC

Re: are random numbers broken?

There are two issues, one is we use hive's deterministic flag in an
opposite way, another one is when drill visit an expression, we take a
previous found holder, but that is not right if this function is
nondeterministic. A JIRA was created and a pull request of fix was posted:

https://issues.apache.org/jira/browse/DRILL-4618
https://github.com/apache/drill/pull/509



On Mon, Apr 11, 2016 at 5:53 PM, Jinfeng Ni <ji...@gmail.com> wrote:

> Sounds like there are two issues.
>
> 1.  random() delivers the same value when used multiple times in each
> returned row. This seems to be caused by a bug in common subexpression
> (CSE) reduction, which identify the two appearances of random() are
> CSE. As a result, the generated code share the only instance of
> random().
>
> 2. rand(). Looks like Drill does not recognize hive's rand() as
> 'isRandom'=true. As such, rand() is regarded as a constant expression
> in generated code.
>
> Both of them are bugs that we should fix.
>