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?
|