drill-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Argenis Leon <argenisl...@mood.com.ve>
Subject rand expected behavior
Date Tue, 16 Aug 2016 05:59:32 GMT
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