drill-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chunhui Shi <c...@maprtech.com>
Subject Re: rand expected behavior
Date Tue, 16 Aug 2016 07:52:20 GMT
There is a JIRA for this: https://issues.apache.org/jira/browse/DRILL-4618
 and a pull request for the fix https://github.com/apache/drill/pull/509

Thanks.

On Mon, Aug 15, 2016 at 10:59 PM, Argenis Leon <argenisleon@mood.com.ve>
wrote:

> Hi guys,
>
> I am trying to get a sample from a database using,
>
> select * from table where rand() <= .3
>
> but it seems that in drill the same random number is used in every row
>
> vars(drill.query('''SELECT rand() FROM `dfs`.`/home/argenisleon/rep.csv`
> LIMIT 10''', timeout))
>
> {'columns': ['EXPR$0'], 'data': {'columns': ['EXPR$0'], 'rows': [{'EXPR$0':
> '0.9510525762405785'}, {'EXPR$0': '0.9510525762405785'}, {'EXPR$0':
> '0.9510525762405785'}, {'EXPR$0': '0.9510525762405785'}, {'EXPR$0':
> '0.9510525762405785'}]}, 'duration': 0.05265951156616211, 'response':
> <Response [200]>, 'rows': [{'EXPR$0': '0.9510525762405785'}, {'EXPR$0':
> '0.9510525762405785'}, {'EXPR$0': '0.9510525762405785'}, {'EXPR$0':
> '0.9510525762405785'}, {'EXPR$0': '0.9510525762405785'}]}
>
> is this the expected behavior?
>

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