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 <[email protected]> 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. >
